Skip to main content

ByteRansEncoderMulti

Struct ByteRansEncoderMulti 

Source
pub struct ByteRansEncoderMulti<const N: usize> { /* private fields */ }
Expand description

Multi-stream interleaved rANS encoder - byte-aligned version.

Implementations§

Source§

impl<const N: usize> ByteRansEncoderMulti<N>

Source

pub fn new(max_len: usize) -> Self

Creates a new ByteMultiRansEncoder instance that can contain max_len bytes in the internal buffer.

Note that most of the API is inside the RansEncoderMulti trait, so you probably want to use rans::RansEncoderMulti.

§Examples
use rans::byte_encoder::ByteRansEncoderMulti;
use rans::RansEncoderMulti;

let encoder = ByteRansEncoderMulti::<2>::new(1024);
assert_eq!(encoder.data(), []);

Trait Implementations§

Source§

impl<const N: usize> Debug for ByteRansEncoderMulti<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RansEncoder for ByteRansEncoderMulti<1>

Source§

fn put(&mut self, symbol: &Self::Symbol)

Puts the specified symbol into this encoder. Read more
Source§

fn flush(&mut self)

Flushes the encoder’s intermediate data into the buffer. Read more
Source§

impl<const N: usize> RansEncoderMulti<N> for ByteRansEncoderMulti<N>

Source§

type Symbol = ByteRansEncSymbol

Type of a Symbol value that can be encoded using this encoder.
Source§

fn reset(&mut self)

Resets this encoder’s internal state, so that the internal buffer becomes empty. Read more
Source§

fn put_at(&mut self, channel: usize, symbol: &Self::Symbol)

Puts a symbol into the specified channel. Read more
Source§

fn flush_at(&mut self, channel: usize)

Flushes the encoder’s intermediate data at given channel into the buffer. Read more
Source§

fn data(&self) -> &[u8] ⓘ

Returns this encoder’s internal buffer content. Read more
Source§

fn flush_all(&mut self)

Flushes the encoder’s intermediate data at all channels into the buffer. Read more
Source§

fn len(&self) -> usize

Returns this encoder’s internal buffer current length in bytes. Read more
Source§

fn is_empty(&self) -> bool

Returns whether this encoder’s internal buffer is empty. Read more

Auto Trait Implementations§

§

impl<const N: usize> !Send for ByteRansEncoderMulti<N>

§

impl<const N: usize> !Sync for ByteRansEncoderMulti<N>

§

impl<const N: usize> Freeze for ByteRansEncoderMulti<N>
where [u32; N]: Freeze,

§

impl<const N: usize> RefUnwindSafe for ByteRansEncoderMulti<N>
where [u32; N]: RefUnwindSafe,

§

impl<const N: usize> Unpin for ByteRansEncoderMulti<N>
where [u32; N]: Unpin,

§

impl<const N: usize> UnsafeUnpin for ByteRansEncoderMulti<N>
where [u32; N]: UnsafeUnpin,

§

impl<const N: usize> UnwindSafe for ByteRansEncoderMulti<N>
where [u32; N]: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.