Struct constriction::Queue[][src]

pub struct Queue {}
Expand description

Zero sized marker trait for first-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 queue, check out the module stream::queue.

Trait Implementations

impl<'a, Word: Clone + 'a, Buf: AsRef<[Word]> + 'a> AsReadWords<'a, Word, Queue> 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<Word, B: BoundedReadWords<Word, Stack>> BoundedReadWords<Word, Queue> 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: AsRef<[Word]>> BoundedReadWords<Word, Queue> 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 Queue[src]

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

Formats the value using the given formatter. Read more

impl Default for Queue[src]

fn default() -> Queue[src]

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

impl<Word: Clone, Buf: AsRef<[Word]>> IntoReadWords<Word, Queue> 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, Queue>> ReadBitStream<Queue> for QueueDecoder<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<Word, B: ReadWords<Word, Stack>> ReadWords<Word, Queue> 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: AsRef<[Word]>> ReadWords<Word, Queue> 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<Queue> for QueueEncoder<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
    C: EncoderCodebook,
    Symbol: Borrow<C::Symbol>, 
[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 Queue[src]

Auto Trait Implementations

impl RefUnwindSafe for Queue

impl Send for Queue

impl Sync for Queue

impl Unpin for Queue

impl UnwindSafe for Queue

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<'a, Word, Buf> AsReadWords<'a, Word, Queue> for Buf where
    Word: 'a + Clone,
    Buf: 'a + AsRef<[Word]>, 
[src]

type AsReadWords = Cursor<Word, &'a [Word]>

The type of the data source as which the original type can be used.

pub fn as_read_words(
    &'a Self
) -> <Buf as AsReadWords<'a, Word, Queue>>::AsReadWords
[src]

Performs the (temporary) conversion.

impl<'a, Word, Buf> AsReadWords<'a, Word, Queue> for Buf where
    Word: 'a + Clone,
    Buf: 'a + AsRef<[Word]>, 
[src]

type AsReadWords = Cursor<Word, &'a [Word]>

The type of the data source as which the original type can be used.

pub fn as_read_words(
    &'a Self
) -> <Buf as AsReadWords<'a, Word, Queue>>::AsReadWords
[src]

Performs the (temporary) conversion.

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<Word, Buf> IntoReadWords<Word, Queue> for Buf where
    Word: Clone,
    Buf: AsRef<[Word]>, 
[src]

type IntoReadWords = Cursor<Word, Buf>

The type of the data source that will result from the conversion.

pub fn into_read_words(
    Self
) -> <Buf as IntoReadWords<Word, Queue>>::IntoReadWords
[src]

Performs the conversion.

impl<Word, Buf> IntoReadWords<Word, Queue> for Buf where
    Word: Clone,
    Buf: AsRef<[Word]>, 
[src]

type IntoReadWords = Cursor<Word, Buf>

The type of the data source that will result from the conversion.

pub fn into_read_words(
    Self
) -> <Buf as IntoReadWords<Word, Queue>>::IntoReadWords
[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.