Struct constriction::Stack

source ·
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§

The type of the data source as which the original type can be used.
Performs the (temporary) conversion.
Returns the number of Words that are left for reading. Read more
Whether or not there is no data left to read. Read more
Returns the number of Words that are left for reading. Read more
Whether or not there is no data left to read. Read more
Returns the number of Words that are left for reading. Read more
Whether or not there is no data left to read. Read more
Returns the number of Words that are left for reading. Read more
Whether or not there is no data left to read. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The type of the data source that will result from the conversion.
Performs the conversion.

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).

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.

Returns true if the data source could be out of data. Read more
The error type that can occur when reading from the data source, or Infallible. Read more
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
Returns true if the data source could be out of data. Read more
The error type that can occur when reading from the data source, or Infallible. Read more
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
Returns true if the data source could be out of data. Read more

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).

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.

Returns true if the data source could be out of 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 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.