pub struct HeatshrinkDecoder<const W: usize, const L: usize, const I: usize, const WIN: usize> { /* private fields */ }Expand description
Heatshrink decoder.
§Type parameters
W: base-2 log of the LZSS sliding window size (must match the encoder).L: number of bits for back-reference lengths (must match the encoder).I: streaming input buffer size in bytes (>= 1, tunable for RAM/throughput).WIN: output (window) buffer size in bytes; must equal1 << W. (Redundant parameter required because Rust stable does not yet support arithmetic on const generics in array sizes.)
Use DefaultDecoder or the dispatch helpers in
heatshrink-bin rather than setting WIN manually.
§Panics
new() panics if: W < 4, L < 3, L >= W,
W > 14, I < 1, or WIN != 1 << W.
Implementations§
Source§impl<const W: usize, const L: usize, const I: usize, const WIN: usize> HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> HeatshrinkDecoder<W, L, I, WIN>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new decoder instance.
§Panics
Panics if W < 4, L < 3, L >= W, W > 15, I < 1,
or WIN != 1 << W.
Sourcepub fn sink(&mut self, input_buffer: &[u8]) -> Result<usize, SinkError>
pub fn sink(&mut self, input_buffer: &[u8]) -> Result<usize, SinkError>
Feed compressed data into the decoder.
Trait Implementations§
Auto Trait Implementations§
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Freeze for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> RefUnwindSafe for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Send for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Sync for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Unpin for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> UnsafeUnpin for HeatshrinkDecoder<W, L, I, WIN>
impl<const W: usize, const L: usize, const I: usize, const WIN: usize> UnwindSafe for HeatshrinkDecoder<W, L, I, WIN>
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