pub trait Stack: Debug {
type Error: Copy + Debug;
// Required methods
fn empty() -> Self;
fn depth(&self) -> usize;
fn peek(&self) -> Option<State>;
fn pop(&mut self) -> Option<State>;
fn push(&mut self, item: State) -> Result<(), Self::Error>;
}
Expand description
A trait representing a stack.
Required Associated Types§
Required Methods§
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.