pub struct RansEncoderStream<S: EncoderVariantForS> { /* private fields */ }Expand description
rANS encoder stream for a specific variant S.
Keeps a persistent raw encoder state across push() calls. flush()
writes the final state and yields the encoded message; the stream can
then be reused. reset() aborts the current session.
Implementations§
Source§impl<S: EncoderVariantForS> RansEncoderStream<S>
impl<S: EncoderVariantForS> RansEncoderStream<S>
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Whether the stream has an active encoder session.
Sourcepub fn push(
&mut self,
encoder: &EntropyEncoder<S>,
indices: &[i32],
values: &[i32],
) -> Result<(), EntropyError>
pub fn push( &mut self, encoder: &EntropyEncoder<S>, indices: &[i32], values: &[i32], ) -> Result<(), EntropyError>
Push an entropy-encoded batch onto the stream.
Encodes values using the given encoder’s PMF, continuing the
persistent raw encoder state. Matches EntropyEncoder::push in
Python and IEntropyEncoderImpl::Encode(stream, indices, values).
Trait Implementations§
Source§impl<S: Debug + EncoderVariantForS> Debug for RansEncoderStream<S>
impl<S: Debug + EncoderVariantForS> Debug for RansEncoderStream<S>
Source§impl<S: EncoderVariantForS> Default for RansEncoderStream<S>
impl<S: EncoderVariantForS> Default for RansEncoderStream<S>
Auto Trait Implementations§
impl<S> Freeze for RansEncoderStream<S>
impl<S> RefUnwindSafe for RansEncoderStream<S>
impl<S> Send for RansEncoderStream<S>
impl<S> Sync for RansEncoderStream<S>
impl<S> Unpin for RansEncoderStream<S>
impl<S> UnsafeUnpin for RansEncoderStream<S>
impl<S> UnwindSafe for RansEncoderStream<S>
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