pub struct RangeDecoder<Word, State, Backend>where
    Word: BitArray,
    State: BitArray,
    Backend: ReadWords<Word, Queue>,
{ /* private fields */ }

Implementations§

Low-level constructor that assembles a RangeDecoder from its internal components.

The arguments bulk, state, and point correspond to the three return values of the method into_raw_parts.

The construction fails if the argument point lies outside of the range represented by state. In this case, the method returns the (unmodified) argument bulk back to the caller, wrapped in an Err variant.

Low-level method that disassembles the RangeDecoder into its internal components.

Can be used together with from_raw_parts.

Same as Decoder::maybe_exhausted, but can be called on a concrete type without type annotations.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The internal coder state, as returned by the method state. Read more
The smallest unit of compressed data that this coder can emit or read at once. Most coders guarantee that encoding emits at most one Word per symbol (plus a constant overhead).
Returns the current internal state of the coder. Read more
Checks if there might not be any room to encode more data. Read more
Checks if there might be no compressed data left for decoding. Read more
Formats the value using the given formatter. Read more

Decodes a single symbol and pops it off the compressed data.

This is a low level method. You usually probably want to call a batch method like decode_symbols or decode_iid_symbols instead.

This method is called decode_symbol rather than decode_symbol to stress the fact that the Coder is a stack: decode_symbol will return the last symbol that was previously encoded via encode_symbol.

Note that this method cannot fail. It will still produce symbols in a deterministic way even if the coder is empty, but such symbols will not recover any previously encoded data and will generally have low entropy. Still, being able to pop off an arbitrary number of symbols can sometimes be useful in edge cases of, e.g., the bits-back algorithm.

The error type for logical decoding errors. Read more
The error type for reading in encoded data. Read more
Checks if there might be no compressed data left for decoding. Read more
Decodes a sequence of symbols, using an individual entropy model for each symbol. Read more
Decodes a sequence of symbols from a fallible iterator over entropy models. Read more
Decodes amt symbols using the same entropy model for all symbols. Read more
Converts to this type from the input type.
Jumps to a given position in the compressed data. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.