pub trait Stack<T>:
Collection<Item = T>
+ Len
+ Back { }Expand description
Immutable stack data structure.
A stack provides two main operations:
PushBack::push_back, which adds an element to the collection, andPopBack::pop_back, which removes the most recently added element that was not yet removed.
This trait alias describes the immutables operations derived from the two main operation above:
Len::len, returning the number of elements in the stack, andBack::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.