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]

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]

Performs the (temporary) conversion.

impl<Array> BoundedReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
    Array: Array
[src]

fn remaining(&self) -> usize[src]

Returns the number of Words that are left for reading. Read more

fn is_exhausted(&self) -> bool[src]

Whether or not there is no data left to read. Read more

impl<Word> BoundedReadWords<Word, Stack> for Vec<Word>[src]

fn remaining(&self) -> usize[src]

Returns the number of Words that are left for reading. Read more

fn is_exhausted(&self) -> bool[src]

Whether or not there is no data left to read. Read more

impl<Word, B: BoundedReadWords<Word, Queue>> BoundedReadWords<Word, Stack> for Reverse<B>[src]

fn remaining(&self) -> usize[src]

Returns the number of Words that are left for reading. Read more

fn is_exhausted(&self) -> bool[src]

Whether or not there is no data left to read. Read more

impl<Word: Clone, Buf: SafeBuf<Word>> BoundedReadWords<Word, Stack> for Cursor<Word, Buf>[src]

fn remaining(&self) -> usize[src]

Returns the number of Words that are left for reading. Read more

fn is_exhausted(&self) -> bool[src]

Whether or not there is no data left to read. Read more

impl Debug for Stack[src]

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

Formats the value using the given formatter. Read more

impl Default for Stack[src]

fn default() -> Stack[src]

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

impl<Word: Clone, Buf: SafeBuf<Word>> IntoReadWords<Word, Stack> for Buf[src]

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]

Performs the conversion.

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]

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]

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]

impl<Array> ReadWords<<Array as Array>::Item, Stack> for SmallVec<Array> where
    Array: Array
[src]

type ReadError = Infallible

The 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]

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]

Returns true if the data source could be out of data. Read more

impl<Word> ReadWords<Word, Stack> for Vec<Word>[src]

type ReadError = Infallible

The 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]

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]

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]

type ReadError = B::ReadError

The 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]

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]

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]

type ReadError = Infallible

The 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]

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]

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]

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]

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]

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]

impl Semantics for Stack[src]

Auto Trait Implementations

impl RefUnwindSafe for Stack

impl Send for Stack

impl Sync for Stack

impl Unpin for Stack

impl UnwindSafe for Stack

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.