Skip to main content

HeatshrinkDecoder

Struct HeatshrinkDecoder 

Source
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 equal 1 << 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>

Source

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.

Source

pub fn reset(&mut self)

Reset the decoder to its initial state so it can be reused.

Source

pub fn sink(&mut self, input_buffer: &[u8]) -> Result<usize, SinkError>

Feed compressed data into the decoder.

Source

pub fn poll(&mut self, output_buffer: &mut [u8]) -> Result<Poll, PollError>

Pull decompressed output out of the decoder into output_buffer.

Source

pub fn finish(&self) -> Finish

Signal end of input.

Trait Implementations§

Source§

impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Debug for HeatshrinkDecoder<W, L, I, WIN>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const W: usize, const L: usize, const I: usize, const WIN: usize> Default for HeatshrinkDecoder<W, L, I, WIN>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.