struct HuffmanTree {
nodes: Vec<HuffmanNode>,
}Available on crate features
bgi and bgi-img only.Fields§
§nodes: Vec<HuffmanNode>Implementations§
Source§impl HuffmanTree
impl HuffmanTree
fn new(weights: &[u32], v2: bool) -> Self
fn decode_token( &self, stream: &mut MsbBitStream<MemReaderRef<'_>>, ) -> Result<usize>
fn encode_token( &self, stream: &mut MsbBitWriter<'_, impl Write>, token: usize, ) -> Result<()>
fn find_path( &self, node_index: usize, token: usize, path: &mut Vec<bool>, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HuffmanTree
impl RefUnwindSafe for HuffmanTree
impl Send for HuffmanTree
impl Sync for HuffmanTree
impl Unpin for HuffmanTree
impl UnwindSafe for HuffmanTree
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more