Struct constriction::Stack [−][src]
pub struct Stack {}Expand description
Zero sized marker trait for last-in-first-out read/write Semantics
This type typically only comes up in advanced use cases that are generic over read/write
semantics. If you are looking for an entropy coder that operates as a stack, check out
the module stream::stack.
Trait Implementations
impl<'a, Word: Clone + 'a, Buf: SafeBuf<Word> + 'a> AsReadWords<'a, Word, Stack> for Buf[src]
impl<'a, Word: Clone + 'a, Buf: SafeBuf<Word> + 'a> AsReadWords<'a, Word, Stack> for Buf[src]type AsReadWords = Cursor<Word, &'a [Word]>
type AsReadWords = Cursor<Word, &'a [Word]>The type of the data source as which the original type can be used.
fn as_read_words(&'a self) -> Self::AsReadWords[src]
fn as_read_words(&'a self) -> Self::AsReadWords[src]Performs the (temporary) conversion.
impl<Array> BoundedReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
Array: Array, [src]
impl<Array> BoundedReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
Array: Array, [src]impl<Word> BoundedReadWords<Word, Stack> for Vec<Word>[src]
impl<Word> BoundedReadWords<Word, Stack> for Vec<Word>[src]impl<Word, B: BoundedReadWords<Word, Queue>> BoundedReadWords<Word, Stack> for Reverse<B>[src]
impl<Word, B: BoundedReadWords<Word, Queue>> BoundedReadWords<Word, Stack> for Reverse<B>[src]impl<Word: Clone, Buf: SafeBuf<Word>> IntoReadWords<Word, Stack> for Buf[src]
impl<Word: Clone, Buf: SafeBuf<Word>> IntoReadWords<Word, Stack> for Buf[src]type IntoReadWords = Cursor<Word, Buf>
type IntoReadWords = Cursor<Word, Buf>The type of the data source that will result from the conversion.
fn into_read_words(self) -> Self::IntoReadWords[src]
fn into_read_words(self) -> Self::IntoReadWords[src]Performs the conversion.
impl<Word: BitArray, B: ReadWords<Word, Stack>> ReadBitStream<Stack> for StackCoder<Word, B>[src]
impl<Word: BitArray, B: ReadWords<Word, Stack>> ReadBitStream<Stack> for StackCoder<Word, B>[src]type ReadError = B::ReadError
fn decode_symbol<C: DecoderCodebook>(
&mut self,
codebook: C
) -> Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Self::ReadError>>[src]
&mut self,
codebook: C
) -> Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Self::ReadError>>
fn read_bit(&mut self) -> Result<Option<bool>, Self::ReadError>[src]
fn decode_symbols<'s, I, C>(
&'s mut self,
codebooks: I
) -> DecodeSymbols<'s, Self, I, S>ⓘNotable traits for DecodeSymbols<'a, Stream, I, S>
impl<'a, Stream, I, C, S> Iterator for DecodeSymbols<'a, Stream, I, S> where
S: Semantics,
Stream: ReadBitStream<S>,
C: DecoderCodebook,
I: Iterator<Item = C>, type Item = Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Stream::ReadError>>; where
I: IntoIterator<Item = C> + 's,
C: DecoderCodebook, [src]
&'s mut self,
codebooks: I
) -> DecodeSymbols<'s, Self, I, S>ⓘ
Notable traits for DecodeSymbols<'a, Stream, I, S>
impl<'a, Stream, I, C, S> Iterator for DecodeSymbols<'a, Stream, I, S> where
S: Semantics,
Stream: ReadBitStream<S>,
C: DecoderCodebook,
I: Iterator<Item = C>, type Item = Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Stream::ReadError>>;I: IntoIterator<Item = C> + 's,
C: DecoderCodebook,
fn decode_iid_symbols<'a, C>(
&'a mut self,
amt: usize,
codebook: &'a C
) -> DecodeSymbols<'a, Self, Take<Repeat<&'a C>>, S>ⓘNotable traits for DecodeSymbols<'a, Stream, I, S>
impl<'a, Stream, I, C, S> Iterator for DecodeSymbols<'a, Stream, I, S> where
S: Semantics,
Stream: ReadBitStream<S>,
C: DecoderCodebook,
I: Iterator<Item = C>, type Item = Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Stream::ReadError>>; where
C: DecoderCodebook, [src]
&'a mut self,
amt: usize,
codebook: &'a C
) -> DecodeSymbols<'a, Self, Take<Repeat<&'a C>>, S>ⓘ
Notable traits for DecodeSymbols<'a, Stream, I, S>
impl<'a, Stream, I, C, S> Iterator for DecodeSymbols<'a, Stream, I, S> where
S: Semantics,
Stream: ReadBitStream<S>,
C: DecoderCodebook,
I: Iterator<Item = C>, type Item = Result<C::Symbol, CoderError<SymbolCodeError<C::InvalidCodeword>, Stream::ReadError>>;C: DecoderCodebook,
impl<Array> ReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
Array: Array, [src]
impl<Array> ReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
Array: Array, [src]type ReadError = Infallible
type ReadError = InfallibleThe only way how reading from a vector can fail is if the vector is empty, but
that’s not considered an error (it returns Ok(None) instead).
fn read(&mut self) -> Result<Option<Array::Item>, Self::ReadError>[src]
fn read(&mut self) -> Result<Option<Array::Item>, Self::ReadError>[src]Pops the word off the end of the vector (= top of the stack). If you instead want to
keep the data unchanged (e.g., because you want to reuse it later) then wrap either
the vector v or or the slice &v[..] in a Cursor.
fn maybe_exhausted(&self) -> bool[src]
fn maybe_exhausted(&self) -> bool[src]Returns true if the data source could be out of data. Read more
impl<Word> ReadWords<Word, Stack> for Vec<Word>[src]
impl<Word> ReadWords<Word, Stack> for Vec<Word>[src]type ReadError = Infallible
type ReadError = InfallibleThe only way how reading from a vector can fail is if the vector is empty, but
that’s not considered an error (it returns Ok(None) instead).
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]Pops the word off the end of the vector (= top of the stack). If you instead want to
keep the data unchanged (e.g., because you want to reuse it later) then wrap either
the vector v or or the slice &v[..] in a Cursor.
fn maybe_exhausted(&self) -> bool[src]
fn maybe_exhausted(&self) -> bool[src]Returns true if the data source could be out of data. Read more
impl<Word, B: ReadWords<Word, Queue>> ReadWords<Word, Stack> for Reverse<B>[src]
impl<Word, B: ReadWords<Word, Queue>> ReadWords<Word, Stack> for Reverse<B>[src]type ReadError = B::ReadError
type ReadError = B::ReadErrorThe error type that can occur when reading from the data source, or Infallible. Read more
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]Reads a single Word from the data source and advances the state of the data source
accordingly (i.e., so that the next read won’t read the same Word again). Read more
fn maybe_exhausted(&self) -> bool[src]
fn maybe_exhausted(&self) -> bool[src]Returns true if the data source could be out of data. Read more
impl<Word: Clone, Buf: SafeBuf<Word>> ReadWords<Word, Stack> for Cursor<Word, Buf>[src]
impl<Word: Clone, Buf: SafeBuf<Word>> ReadWords<Word, Stack> for Cursor<Word, Buf>[src]type ReadError = Infallible
type ReadError = InfallibleThe error type that can occur when reading from the data source, or Infallible. Read more
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]
fn read(&mut self) -> Result<Option<Word>, Self::ReadError>[src]Reads a single Word from the data source and advances the state of the data source
accordingly (i.e., so that the next read won’t read the same Word again). Read more
fn maybe_exhausted(&self) -> bool[src]
fn maybe_exhausted(&self) -> bool[src]Returns true if the data source could be out of data. Read more
impl<Word: BitArray, B: WriteWords<Word>> WriteBitStream<Stack> for StackCoder<Word, B>[src]
impl<Word: BitArray, B: WriteWords<Word>> WriteBitStream<Stack> for StackCoder<Word, B>[src]type WriteError = B::WriteError
fn write_bit(&mut self, bit: bool) -> Result<(), Self::WriteError>[src]
fn encode_symbol<Symbol, C>(
&mut self,
symbol: Symbol,
codebook: C
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
Symbol: Borrow<C::Symbol>,
C: EncoderCodebook, [src]
&mut self,
symbol: Symbol,
codebook: C
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
Symbol: Borrow<C::Symbol>,
C: EncoderCodebook,
fn encode_symbols<Symbol, C>(
&mut self,
symbols_and_codebooks: impl IntoIterator<Item = (Symbol, C)>
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
C: EncoderCodebook,
Symbol: Borrow<C::Symbol>, [src]
&mut self,
symbols_and_codebooks: impl IntoIterator<Item = (Symbol, C)>
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
C: EncoderCodebook,
Symbol: Borrow<C::Symbol>,
fn encode_iid_symbols<Symbol, C>(
&mut self,
symbols: impl IntoIterator<Item = Symbol>,
codebook: &C
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
C: EncoderCodebook,
Symbol: Borrow<C::Symbol>, [src]
&mut self,
symbols: impl IntoIterator<Item = Symbol>,
codebook: &C
) -> Result<(), CoderError<DefaultEncoderFrontendError, Self::WriteError>> where
C: EncoderCodebook,
Symbol: Borrow<C::Symbol>,