pub enum EncoderSituation<Word> {
    Normal,
    Inverted(NonZeroUsize, Word),
}
Expand description

Keeps track of yet-to-be-finalized compressed words during encoding with a RangeEncoder.

This type is mostly for internal use. It is only expsed via RangeEncoder::into_raw_parts and RangeEncoder::from_raw_parts.

Variants§

§

Normal

In the Normal situation, all full Words of compressed data have been written to the backend (or “bulk”), and the internal coder state holds less than one word of additional information content.

§

Inverted(NonZeroUsize, Word)

The Inverted situation occurs only rarely. In this situation, some full words of compressed data have been held back and not yet written to the backend (or “bulk”) because their final values may still change depending on subsequently encoded symbols.

More precisely, a situation of Inverted(num_subsequent, first_word) means that the held-back words can become either first_word + 1 followed by num_subsequent zero words, or first_word followed by num_subsequent words that have all bits set.

Trait Implementations§

source§

impl<Word: Clone> Clone for EncoderSituation<Word>

source§

fn clone(&self) -> EncoderSituation<Word>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Word: Debug> Debug for EncoderSituation<Word>

source§

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

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

impl<Word> Default for EncoderSituation<Word>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Word: PartialEq> PartialEq for EncoderSituation<Word>

source§

fn eq(&self, other: &EncoderSituation<Word>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Word: Copy> Copy for EncoderSituation<Word>

source§

impl<Word: Eq> Eq for EncoderSituation<Word>

source§

impl<Word> StructuralEq for EncoderSituation<Word>

source§

impl<Word> StructuralPartialEq for EncoderSituation<Word>

Auto Trait Implementations§

§

impl<Word> RefUnwindSafe for EncoderSituation<Word>
where Word: RefUnwindSafe,

§

impl<Word> Send for EncoderSituation<Word>
where Word: Send,

§

impl<Word> Sync for EncoderSituation<Word>
where Word: Sync,

§

impl<Word> Unpin for EncoderSituation<Word>
where Word: Unpin,

§

impl<Word> UnwindSafe for EncoderSituation<Word>
where Word: 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.