pub struct DDict<'a>(pub(crate) NonNull<ZSTD_DDict>, pub(crate) PhantomData<&'a ()>);Expand description
A digested decompression dictionary.
Tuple Fields§
§0: NonNull<ZSTD_DDict>§1: PhantomData<&'a ()>Implementations§
Source§impl DDict<'static>
impl DDict<'static>
Sourcepub fn create(dict_buffer: &[u8]) -> Self
pub fn create(dict_buffer: &[u8]) -> Self
Prepare a dictionary to decompress data.
The dictionary content will be copied internally, and does not need to be kept around.
§Panics
If loading this dictionary failed. See DDict::try_create.
Sourcepub fn try_create(dict_buffer: &[u8]) -> Option<Self>
pub fn try_create(dict_buffer: &[u8]) -> Option<Self>
Prepare a dictionary to decompress data.
The dictionary content will be copied internally, and does not need to be kept around.
Returns None if zstd could not load the dictionary, for instance because it starts
with the dictionary magic number but its header is corrupt.
Source§impl<'a> DDict<'a>
impl<'a> DDict<'a>
pub fn sizeof(&self) -> usize
Sourcepub fn get_dict_id(&self) -> Option<NonZeroU32>
pub fn get_dict_id(&self) -> Option<NonZeroU32>
Returns the dictionary ID for this dict.
Returns None if this dictionary is empty or invalid.
Trait Implementations§
impl<'a> Send for DDict<'a>
impl<'a> Sync for DDict<'a>
Auto Trait Implementations§
impl<'a> Freeze for DDict<'a>
impl<'a> RefUnwindSafe for DDict<'a>
impl<'a> Unpin for DDict<'a>
impl<'a> UnsafeUnpin for DDict<'a>
impl<'a> UnwindSafe for DDict<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more