Struct huffman_compress::Book
source · pub struct Book<K> { /* private fields */ }
Expand description
A codebook used for encoding.
Implementations§
source§impl<K: Ord + Clone> Book<K>
impl<K: Ord + Clone> Book<K>
sourcepub fn into_inner(self) -> BTreeMap<K, BitVec>
pub fn into_inner(self) -> BTreeMap<K, BitVec>
Returns the underlying B-Tree.
sourcepub fn iter(&self) -> Iter<'_, K, BitVec>
pub fn iter(&self) -> Iter<'_, K, BitVec>
An iterator over all symbol and code word pairs, sorted by symbol.
sourcepub fn get<Q>(&self, k: &Q) -> Option<&BitVec>where
K: Borrow<Q>,
Q: Ord + ?Sized,
pub fn get<Q>(&self, k: &Q) -> Option<&BitVec>where K: Borrow<Q>, Q: Ord + ?Sized,
Returns the code word for a given symbol.
Trait Implementations§
Auto Trait Implementations§
impl<K> RefUnwindSafe for Book<K>where K: RefUnwindSafe,
impl<K> Send for Book<K>where K: Send,
impl<K> Sync for Book<K>where K: Sync,
impl<K> Unpin for Book<K>
impl<K> UnwindSafe for Book<K>where K: RefUnwindSafe,
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