pub struct Frequency {
pub count: usize,
pub character: Option<char>,
}Expand description
Struct that represents the frequency of the different characters found in a string.
Fields§
§count: usizefrequency is a value between 0 and 65536 and is equal to n/65536
character: Option<char>char that the frequency represents. It is optional as in when we store frequencies in the Huffman tree we have nodes that hold a combined frequency of the two children but do not hold any character.
Implementations§
Trait Implementations§
source§impl Ord for Frequency
impl Ord for Frequency
source§impl PartialEq for Frequency
impl PartialEq for Frequency
source§impl PartialOrd for Frequency
impl PartialOrd for Frequency
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Frequency
impl Eq for Frequency
impl StructuralPartialEq for Frequency
Auto Trait Implementations§
impl Freeze for Frequency
impl RefUnwindSafe for Frequency
impl Send for Frequency
impl Sync for Frequency
impl Unpin for Frequency
impl UnwindSafe for Frequency
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