pub struct BitsPerFragment(pub u8);Expand description
BitsPerFragment represents the Huffman’s tree degree that is the power of two.
It represents number of bits needed to store the degree.
It can be used to construct minimum-redundancy coding whose
codeword lengths are a multiple of this number of bits.
It is faster than Degree and should be preferred
for degrees that are the powers of two.
Tuple Fields§
§0: u8Trait Implementations§
Source§impl Clone for BitsPerFragment
impl Clone for BitsPerFragment
Source§fn clone(&self) -> BitsPerFragment
fn clone(&self) -> BitsPerFragment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 Mul<u32> for BitsPerFragment
impl Mul<u32> for BitsPerFragment
Source§impl TreeDegree for BitsPerFragment
impl TreeDegree for BitsPerFragment
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 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 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§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).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.
fn reverse_code(&self, bits: u32, len: u32) -> u32
Source§impl TryFrom<Degree> for BitsPerFragment
impl TryFrom<Degree> for BitsPerFragment
impl Copy for BitsPerFragment
Auto Trait Implementations§
impl Freeze for BitsPerFragment
impl RefUnwindSafe for BitsPerFragment
impl Send for BitsPerFragment
impl Sync for BitsPerFragment
impl Unpin for BitsPerFragment
impl UnwindSafe for BitsPerFragment
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