Expand description

A collection of different implementations of a stack based on the LIFO principle.

Currently, the following implementations are available:

  • Stack: A linked stack based on nodes.
  • ArrayStack: A stack based on an array.

For more information, see the respective structs’ documentation.

For a pure FIFO or a mixed LIFO/FIFO data structure, see the queue module.

Structs

A fixed-size stack capable of expanding when needed. It is implemented using Vec, so the elements are stored contiguously in memory. The main difference between this and a Stack is that this one does not use nodes.
Iterator over the elements of a ArrayStack. This struct is created by the into_iter method on ArrayStack. See its documentation for more.
A stack is a collection that follows the LIFO (last-in-first-out) principle. This means that elements are added to the top of the stack and removed from the top of the stack. This implementation uses a linked-based structure.
Iterator over the elements of a Stack. This struct is created by the into_iter method on Stack. See its documentation for more.
An immutable iterator over the elements of a Stack. This struct is created by the iter method on Stack. See its documentation for more.
A mutable iterator over the elements of a Stack. This struct is created by the iter_mut method on Stack. See its documentation for more.