pub struct RansByteEncoder<Sk>{ /* private fields */ }Expand description
Raw rANS encoder.
Implementations§
Source§impl<Sk> RansByteEncoder<Sk>
impl<Sk> RansByteEncoder<Sk>
pub fn new(sink: Sk) -> RansByteEncoder<Sk>
pub fn sink(&self) -> &Sk
pub fn sink_mut(&mut self) -> &mut Sk
pub fn into_sink(self) -> Sk
pub fn state(&self) -> u32
pub fn reset(&mut self)
Sourcepub fn put_raw(&mut self, start: u32, freq: u32, scale_bits: u32)
pub fn put_raw(&mut self, start: u32, freq: u32, scale_bits: u32)
Put a raw symbol (start, freq, scale_bits) using division.
Panics if scale_bits >= 32 (overflow at 1u32 << scale_bits).
Use try_put_raw for a Result-returning checked variant.
Sourcepub fn try_put_raw(
&mut self,
start: u32,
freq: u32,
scale_bits: u32,
) -> Result<(), RawRansError>
pub fn try_put_raw( &mut self, start: u32, freq: u32, scale_bits: u32, ) -> Result<(), RawRansError>
Put a raw symbol with bounds checking on scale_bits.
Returns Err(RawRansError::InvalidScaleBits) if scale_bits is
outside the safe range (see $enc_symbol::try_new).
Sourcepub fn put(&mut self, symbol: &RansByteEncSymbol)
pub fn put(&mut self, symbol: &RansByteEncSymbol)
Put a prepared symbol (fast reciprocal-multiply path).
Trait Implementations§
Auto Trait Implementations§
impl<Sk> Freeze for RansByteEncoder<Sk>where
Sk: Freeze,
impl<Sk> RefUnwindSafe for RansByteEncoder<Sk>where
Sk: RefUnwindSafe,
impl<Sk> Send for RansByteEncoder<Sk>where
Sk: Send,
impl<Sk> Sync for RansByteEncoder<Sk>where
Sk: Sync,
impl<Sk> Unpin for RansByteEncoder<Sk>where
Sk: Unpin,
impl<Sk> UnsafeUnpin for RansByteEncoder<Sk>where
Sk: UnsafeUnpin,
impl<Sk> UnwindSafe for RansByteEncoder<Sk>where
Sk: UnwindSafe,
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