pub struct RangeDecoder<Word, State, Backend>{ /* private fields */ }Implementations§
Source§impl<Word, State, Backend> RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> RangeDecoder<Word, State, Backend>
pub fn from_compressed<Buf>(compressed: Buf) -> Result<Self, Backend::ReadError>where
Buf: IntoReadWords<Word, Queue, IntoReadWords = Backend>,
pub fn with_backend(backend: Backend) -> Result<Self, Backend::ReadError>
pub fn for_compressed<'a, Buf>(
compressed: &'a Buf,
) -> Result<Self, Backend::ReadError>where
Buf: AsReadWords<'a, Word, Queue, AsReadWords = Backend>,
Sourcepub fn from_raw_parts(
bulk: Backend,
state: RangeCoderState<Word, State>,
point: State,
) -> Result<Self, Backend>
pub fn from_raw_parts( bulk: Backend, state: RangeCoderState<Word, State>, point: State, ) -> Result<Self, Backend>
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.
Sourcepub fn into_raw_parts(self) -> (Backend, RangeCoderState<Word, State>, State)
pub fn into_raw_parts(self) -> (Backend, RangeCoderState<Word, State>, State)
Low-level method that disassembles the RangeDecoder into its internal components.
Can be used together with from_raw_parts.
Sourcepub fn maybe_exhausted(&self) -> bool
pub fn maybe_exhausted(&self) -> bool
Same as Decoder::maybe_exhausted, but can be called on a concrete type without
type annotations.
Trait Implementations§
Source§impl<Word, State, Backend> Clone for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Clone for RangeDecoder<Word, State, Backend>
Source§fn clone(&self) -> RangeDecoder<Word, State, Backend>
fn clone(&self) -> RangeDecoder<Word, State, Backend>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Word, State, Backend> Code for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Code for RangeDecoder<Word, State, Backend>
Source§type State = RangeCoderState<Word, State>
type State = RangeCoderState<Word, State>
Source§type Word = Word
type Word = Word
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).Source§impl<Word, State, Backend> Debug for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Debug for RangeDecoder<Word, State, Backend>
Source§impl<Word, State, Backend, const PRECISION: usize> Decode<PRECISION> for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend, const PRECISION: usize> Decode<PRECISION> for RangeDecoder<Word, State, Backend>
Source§type FrontendError = DecoderFrontendError
type FrontendError = DecoderFrontendError
The error type for logical decoding errors. Read more
Source§type BackendError = <Backend as ReadWords<Word, Queue>>::ReadError
type BackendError = <Backend as ReadWords<Word, Queue>>::ReadError
The error type for reading in encoded data. Read more
Source§fn decode_symbol<D>(
&mut self,
model: D,
) -> Result<D::Symbol, CoderError<Self::FrontendError, Self::BackendError>>where
D: DecoderModel<PRECISION>,
D::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<D::Probability>,
fn decode_symbol<D>(
&mut self,
model: D,
) -> Result<D::Symbol, CoderError<Self::FrontendError, Self::BackendError>>where
D: DecoderModel<PRECISION>,
D::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<D::Probability>,
Decodes a single symbol using the given entropy model. Read more
Source§fn maybe_exhausted(&self) -> bool
fn maybe_exhausted(&self) -> bool
Checks if there might be no compressed data left for decoding. Read more
Source§fn decode_symbols<'s, I, M>(
&'s mut self,
models: I,
) -> DecodeSymbols<'s, Self, I::IntoIter, PRECISION> ⓘwhere
I: IntoIterator<Item = M> + 's,
M: DecoderModel<PRECISION>,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
fn decode_symbols<'s, I, M>(
&'s mut self,
models: I,
) -> DecodeSymbols<'s, Self, I::IntoIter, PRECISION> ⓘwhere
I: IntoIterator<Item = M> + 's,
M: DecoderModel<PRECISION>,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
Decodes a sequence of symbols, using an individual entropy model for each symbol. Read more
Source§fn try_decode_symbols<'s, I, M, E>(
&'s mut self,
models: I,
) -> TryDecodeSymbols<'s, Self, I::IntoIter, PRECISION> ⓘwhere
I: IntoIterator<Item = Result<M, E>> + 's,
M: DecoderModel<PRECISION>,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
fn try_decode_symbols<'s, I, M, E>(
&'s mut self,
models: I,
) -> TryDecodeSymbols<'s, Self, I::IntoIter, PRECISION> ⓘwhere
I: IntoIterator<Item = Result<M, E>> + 's,
M: DecoderModel<PRECISION>,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
Decodes a sequence of symbols from a fallible iterator over entropy models. Read more
Source§fn decode_iid_symbols<M>(
&mut self,
amt: usize,
model: M,
) -> DecodeIidSymbols<'_, Self, M, PRECISION> ⓘwhere
M: DecoderModel<PRECISION> + Copy,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
fn decode_iid_symbols<M>(
&mut self,
amt: usize,
model: M,
) -> DecodeIidSymbols<'_, Self, M, PRECISION> ⓘwhere
M: DecoderModel<PRECISION> + Copy,
M::Probability: Into<Self::Word>,
Self::Word: AsPrimitive<M::Probability>,
Decodes
amt symbols using the same entropy model for all symbols. Read moreSource§impl<Word, State, Backend> From<RangeEncoder<Word, State, Backend>> for RangeDecoder<Word, State, Backend::IntoReadWords>where
Word: BitArray + Into<State>,
State: BitArray + AsPrimitive<Word>,
Backend: WriteWords<Word> + IntoReadWords<Word, Queue>,
impl<Word, State, Backend> From<RangeEncoder<Word, State, Backend>> for RangeDecoder<Word, State, Backend::IntoReadWords>where
Word: BitArray + Into<State>,
State: BitArray + AsPrimitive<Word>,
Backend: WriteWords<Word> + IntoReadWords<Word, Queue>,
Source§fn from(encoder: RangeEncoder<Word, State, Backend>) -> Self
fn from(encoder: RangeEncoder<Word, State, Backend>) -> Self
Converts to this type from the input type.
Source§impl<Word, State, Backend> PosSeek for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> PosSeek for RangeDecoder<Word, State, Backend>
Source§impl<Word, State, Backend> Seek for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Seek for RangeDecoder<Word, State, Backend>
Auto Trait Implementations§
impl<Word, State, Backend> Freeze for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> RefUnwindSafe for RangeDecoder<Word, State, Backend>where
Backend: RefUnwindSafe,
State: RefUnwindSafe,
<State as BitArray>::NonZero: RefUnwindSafe,
Word: RefUnwindSafe,
impl<Word, State, Backend> Send for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Sync for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> Unpin for RangeDecoder<Word, State, Backend>
impl<Word, State, Backend> UnwindSafe for RangeDecoder<Word, State, Backend>where
Backend: UnwindSafe,
State: UnwindSafe,
<State as BitArray>::NonZero: UnwindSafe,
Word: UnwindSafe,
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