pub struct AnsDecoder<'a> { /* private fields */ }Expand description
rANS decoder.
Decodes symbols from a stream of 16-bit words. Stream format: [state: u32 LE] [word_count: u32 LE] [words: u16 LE…]
Words are read in FIFO order (first word in stream is first word consumed).
Implementations§
Source§impl<'a> AnsDecoder<'a>
impl<'a> AnsDecoder<'a>
Sourcepub fn new(data: &'a [u8]) -> CodecResult<Self>
pub fn new(data: &'a [u8]) -> CodecResult<Self>
Create a new ANS decoder from encoded data.
Sourcepub fn decode_symbol(&mut self, dist: &AnsDistribution) -> CodecResult<u16>
pub fn decode_symbol(&mut self, dist: &AnsDistribution) -> CodecResult<u16>
Decode a single symbol using the given distribution.
Auto Trait Implementations§
impl<'a> Freeze for AnsDecoder<'a>
impl<'a> RefUnwindSafe for AnsDecoder<'a>
impl<'a> Send for AnsDecoder<'a>
impl<'a> Sync for AnsDecoder<'a>
impl<'a> Unpin for AnsDecoder<'a>
impl<'a> UnsafeUnpin for AnsDecoder<'a>
impl<'a> UnwindSafe for AnsDecoder<'a>
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