#[non_exhaustive]pub struct AlphabetShape {
pub code_lengths: Vec<u8>,
pub declared_count: usize,
}Expand description
Shape of one alphabet declared by a dynamic-Huffman block.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code_lengths: Vec<u8>Code length for every symbol in alphabet order, including zero lengths.
declared_count: usizeNumber of code lengths physically declared by the header.
Implementations§
Source§impl AlphabetShape
impl AlphabetShape
Sourcepub fn used_count(&self) -> usize
pub fn used_count(&self) -> usize
Returns the number of symbols with non-zero code lengths.
Sourcepub fn length_range(&self) -> Option<(u8, u8)>
pub fn length_range(&self) -> Option<(u8, u8)>
Returns the shortest and longest non-zero code lengths.
Sourcepub fn counts_by_length(&self) -> Vec<(u8, usize)>
pub fn counts_by_length(&self) -> Vec<(u8, usize)>
Returns symbol counts grouped by code length, shortest first.
Trait Implementations§
Source§impl Clone for AlphabetShape
impl Clone for AlphabetShape
Source§fn clone(&self) -> AlphabetShape
fn clone(&self) -> AlphabetShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlphabetShape
impl Debug for AlphabetShape
Source§impl Default for AlphabetShape
impl Default for AlphabetShape
Source§fn default() -> AlphabetShape
fn default() -> AlphabetShape
Returns the “default value” for a type. Read more
impl Eq for AlphabetShape
Source§impl PartialEq for AlphabetShape
impl PartialEq for AlphabetShape
impl StructuralPartialEq for AlphabetShape
Auto Trait Implementations§
impl Freeze for AlphabetShape
impl RefUnwindSafe for AlphabetShape
impl Send for AlphabetShape
impl Sync for AlphabetShape
impl Unpin for AlphabetShape
impl UnsafeUnpin for AlphabetShape
impl UnwindSafe for AlphabetShape
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