pub struct Decoder { /* private fields */ }
Expand description
A huffman decoder that reads successive tables and data from pages
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(page_size: usize, page_threshold: usize) -> Decoder
pub fn new(page_size: usize, page_threshold: usize) -> Decoder
Create a decoder that reads pages of page_size
bytes
Every page_threshold
pages, the decoder will rebuild the huffman tree
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Prepare the decoder for a new round of decoding this keeps allocations, so its cheaper than a Decoder::new call
Sourcepub async fn drain<E>(
&mut self,
input: &mut impl PageReader<E>,
) -> Result<Option<u8>, DecompressionError<E>>
pub async fn drain<E>( &mut self, input: &mut impl PageReader<E>, ) -> Result<Option<u8>, DecompressionError<E>>
Drain a byte from the decoder
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin 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