Struct steap_by_steap::compression::HuffmanNode
source · struct HuffmanNode {
freq: usize,
ch: Option<char>,
left: Option<Box<HuffmanNode>>,
right: Option<Box<HuffmanNode>>,
}
Fields§
§freq: usize
§ch: Option<char>
§left: Option<Box<HuffmanNode>>
§right: Option<Box<HuffmanNode>>
Implementations§
source§impl HuffmanNode
impl HuffmanNode
fn new_leaf(ch: char, freq: usize) -> Self
fn new_internal(freq: usize, left: HuffmanNode, right: HuffmanNode) -> Self
fn generate_codes(&self, prefix: String, codes: &mut HashMap<char, String>)
Trait Implementations§
source§impl Debug for HuffmanNode
impl Debug for HuffmanNode
source§impl Ord for HuffmanNode
impl Ord for HuffmanNode
source§impl PartialEq for HuffmanNode
impl PartialEq for HuffmanNode
source§fn eq(&self, other: &HuffmanNode) -> bool
fn eq(&self, other: &HuffmanNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for HuffmanNode
impl PartialOrd for HuffmanNode
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 Eq for HuffmanNode
impl StructuralPartialEq for HuffmanNode
Auto Trait Implementations§
impl Freeze for HuffmanNode
impl RefUnwindSafe for HuffmanNode
impl Send for HuffmanNode
impl Sync for HuffmanNode
impl Unpin for HuffmanNode
impl UnwindSafe for HuffmanNode
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