Skip to main content

Huf4

Struct Huf4 

Source
pub struct Huf4<'a> {
    pub table: &'a [u16; 2048],
    pub src: &'a [u8],
    pub starts: [usize; 4],
    pub pos: [usize; 4],
    pub bits: [u64; 4],
    pub out: &'a mut [u8],
    pub seg: usize,
    pub done: usize,
}
Expand description

The state of zstd’s four-stream Huffman fast loop (HUF_decompress4X1 “fast”): per stream a left-aligned 64-bit container with a marker bit below the unread bits, and its position in the input.

Fields§

§table: &'a [u16; 2048]

Entries symbol << 8 | bits, indexed by the next 11 bits.

§src: &'a [u8]

The four streams, one after another.

§starts: [usize; 4]

Where each stream starts in src.

§pos: [usize; 4]

Each stream’s position (the 8 bytes loaded last): starts[j] <= pos[j], pos[j] + 8 <= src.len().

§bits: [u64; 4]§out: &'a mut [u8]

The output: stream j writes out[j * seg + i]; stream 3 has out.len() - 3 * seg.

§seg: usize§done: usize

Symbols per stream done so far.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Huf4<'a>

§

impl<'a> Forget for Huf4<'a>

§

impl<'a> Freeze for Huf4<'a>

§

impl<'a> Move for Huf4<'a>

§

impl<'a> RefUnwindSafe for Huf4<'a>

§

impl<'a> Send for Huf4<'a>

§

impl<'a> Sync for Huf4<'a>

§

impl<'a> Unpin for Huf4<'a>

§

impl<'a> UnsafeUnpin for Huf4<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.