pub struct Decoder { /* private fields */ }Expand description
Reusable OpenZL decoder with scratch buffers and codec state.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a decoder with Options::default.
Sourcepub fn with_options(options: Options) -> Self
pub fn with_options(options: Options) -> Self
Creates a decoder with explicit options.
pub fn options(&self) -> Options
pub fn limits(&self) -> Limits
Sourcepub fn load_dictionary_bundle(&mut self, bytes: &[u8]) -> Result<()>
pub fn load_dictionary_bundle(&mut self, bytes: &[u8]) -> Result<()>
Loads an OpenZL dictionary bundle for later dictionary-backed decode.
Currently only zstd dictionary materialization is implemented.
Sourcepub fn load_fat_bundle(&mut self, bytes: &[u8]) -> Result<()>
pub fn load_fat_bundle(&mut self, bytes: &[u8]) -> Result<()>
Loads a fat OpenZL dictionary bundle for later dictionary-backed decode.
Prefer Decoder::load_dictionary_bundle for new code.
Sourcepub fn clear_dictionary_bundles(&mut self)
pub fn clear_dictionary_bundles(&mut self)
Clears all loaded dictionary bundles.
Sourcepub fn decode_into(&mut self, input: &[u8], dst: &mut Vec<u8>) -> Result<usize>
pub fn decode_into(&mut self, input: &[u8], dst: &mut Vec<u8>) -> Result<usize>
Decodes one OpenZL frame and appends the decoded bytes to dst.
Returns the number of bytes appended. On error, dst is restored to its
original length.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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