Stack

Trait Stack 

Source
pub trait Stack<T>:
    Collection<Item = T>
    + Len
    + Back { }
Expand description

Immutable stack data structure.

A stack provides two main operations:

This trait alias describes the immutables operations derived from the two main operation above:

  • Len::len, returning the number of elements in the stack, and
  • Back::back, returning a reference to the most recently added element that was not yet removed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, C: Collection<Item = T> + Len + Back> Stack<T> for C