pub struct DirectHuff { /* private fields */ }Expand description
A Huffman table in “direct lookup” form: peek_bits bits index a table of
code_len << 8 | symbol entries (zero for unused codes, which consume no bits and
decode to symbol 0, which is how incomplete tables behave).
Implementations§
Source§impl DirectHuff
impl DirectHuff
Sourcepub fn from_counts(source: &[u8]) -> Result<Self>
pub fn from_counts(source: &[u8]) -> Result<Self>
Build from a table source: 16 code-length counts followed by the symbols in code order.
Sourcepub fn from_direct(peek_bits: u32, direct: Vec<u16>) -> Self
pub fn from_direct(peek_bits: u32, direct: Vec<u16>) -> Self
Build from a direct table of 1 << peek_bits entries (code_len << 8 | symbol).
pub fn peek_bits(&self) -> u32
Trait Implementations§
Source§impl Clone for DirectHuff
impl Clone for DirectHuff
Auto Trait Implementations§
impl Forget for DirectHuff
impl Freeze for DirectHuff
impl RefUnwindSafe for DirectHuff
impl Send for DirectHuff
impl Sync for DirectHuff
impl Unpin for DirectHuff
impl UnsafeUnpin for DirectHuff
impl UnwindSafe for DirectHuff
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more