pub struct Degree(pub u32);Expand description
Degree represents the degree of the Huffman tree.
It is slower than BitsPerFragment and should be avoided
when the degree is the power of two.
Tuple Fields§
§0: u32Trait Implementations§
Source§impl From<BitsPerFragment> for Degree
impl From<BitsPerFragment> for Degree
Source§fn from(bits_per_fragment: BitsPerFragment) -> Self
fn from(bits_per_fragment: BitsPerFragment) -> Self
Converts to this type from the input type.
Source§impl TreeDegree for Degree
impl TreeDegree for Degree
Source§fn get_fragment(&self, bits: u32, fragment_nr: u32) -> u32
fn get_fragment(&self, bits: u32, fragment_nr: u32) -> u32
Returns the
fragment_nr-th fragment of bits. Result is less than self.tree_degree().Source§fn code_capacity(&self) -> u8
fn code_capacity(&self) -> u8
Returns the largest number of fragments that can be explicitly stored in the code.
Longer codes begin with a sequence of zeros and only their last fragments are explicitly represented.
Source§fn pop_front(&self, bits: &mut u32) -> u32
fn pop_front(&self, bits: &mut u32) -> u32
Removes from
bits and returns its fragment stored on least significant digit (bits).fn reverse_code(&self, bits: u32, len: u32) -> u32
Source§fn write_size_bytes(&self) -> usize
fn write_size_bytes(&self) -> usize
Returns number of bytes that
self.write writes to the output.Source§fn push_front(&self, bits: &mut u32, fragment: u32)
fn push_front(&self, bits: &mut u32, fragment: u32)
Appends the
fragment (that must be less than self.tree_degree)
to the least significant digit (bits) of bits.Source§impl TryFrom<Degree> for BitsPerFragment
impl TryFrom<Degree> for BitsPerFragment
impl Copy for Degree
Auto Trait Implementations§
impl Freeze for Degree
impl RefUnwindSafe for Degree
impl Send for Degree
impl Sync for Degree
impl Unpin for Degree
impl UnwindSafe for Degree
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