pub struct DecoderWorkspace { /* private fields */ }Expand description
A decoder whose internal tables and history storage are allocated up front.
After construction, decoding a valid frame whose window does not exceed
max_window_size into a sufficiently large caller buffer does not request
additional heap storage. Dictionaries must be installed before relying on
that prepared-operation guarantee.
Implementations§
Source§impl DecoderWorkspace
impl DecoderWorkspace
Sourcepub fn new(
max_window_size: usize,
max_dictionary_size: usize,
) -> Result<Self, DecoderWorkspaceError>
pub fn new( max_window_size: usize, max_dictionary_size: usize, ) -> Result<Self, DecoderWorkspaceError>
Allocates and prepares all storage required by a bounded decoder.
pub const fn max_window_size(&self) -> usize
pub const fn max_dictionary_size(&self) -> usize
Sourcepub fn decode_into(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<usize, DecoderWorkspaceError>
pub fn decode_into( &mut self, input: &[u8], output: &mut [u8], ) -> Result<usize, DecoderWorkspaceError>
Decodes complete concatenated frames into caller-owned output storage.
Sourcepub fn decode_into_with_dictionary(
&mut self,
input: &[u8],
dictionary: &[u8],
output: &mut [u8],
) -> Result<usize, DecoderWorkspaceError>
pub fn decode_into_with_dictionary( &mut self, input: &[u8], dictionary: &[u8], output: &mut [u8], ) -> Result<usize, DecoderWorkspaceError>
Decodes using one formatted dictionary without allocating an owning dictionary object or registering it in the decoder.
Sourcepub fn decoder_mut(&mut self) -> &mut FrameDecoder ⓘ
pub fn decoder_mut(&mut self) -> &mut FrameDecoder ⓘ
Accesses the underlying decoder to install formatted dictionaries during workspace preparation.
Sourcepub fn decode_into_with_raw_dictionary(
&mut self,
input: &[u8],
dictionary: &[u8],
output: &mut [u8],
) -> Result<usize, DecoderWorkspaceError>
pub fn decode_into_with_raw_dictionary( &mut self, input: &[u8], dictionary: &[u8], output: &mut [u8], ) -> Result<usize, DecoderWorkspaceError>
Decodes a frame prepared with a raw-content dictionary.
Auto Trait Implementations§
impl Freeze for DecoderWorkspace
impl RefUnwindSafe for DecoderWorkspace
impl Send for DecoderWorkspace
impl Sync for DecoderWorkspace
impl Unpin for DecoderWorkspace
impl UnsafeUnpin for DecoderWorkspace
impl UnwindSafe for DecoderWorkspace
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