pub struct PrefixEncoder { /* private fields */ }Expand description
An encoder-side prefix code: per-symbol emit patterns + lengths, with the single-symbol
(0-bit) special case tracked so emission stays in lock-step with PrefixCode::read_symbol.
Implementations§
Source§impl PrefixEncoder
impl PrefixEncoder
Sourcepub fn from_lengths(lengths: &[u8]) -> Self
pub fn from_lengths(lengths: &[u8]) -> Self
Builds an encoder from per-symbol lengths.
Sourcepub fn write_symbol(&self, w: &mut BitWriter, symbol: usize)
pub fn write_symbol(&self, w: &mut BitWriter, symbol: usize)
Writes symbol to w. A single-symbol code writes nothing (0 bits).
Trait Implementations§
Source§impl Clone for PrefixEncoder
impl Clone for PrefixEncoder
Source§fn clone(&self) -> PrefixEncoder
fn clone(&self) -> PrefixEncoder
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 moreAuto Trait Implementations§
impl Freeze for PrefixEncoder
impl RefUnwindSafe for PrefixEncoder
impl Send for PrefixEncoder
impl Sync for PrefixEncoder
impl Unpin for PrefixEncoder
impl UnsafeUnpin for PrefixEncoder
impl UnwindSafe for PrefixEncoder
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