pub trait ItemStack<I> {
// Required methods
fn len(&self) -> usize;
fn clear(&mut self);
fn push(&mut self, u: I);
fn pop(&mut self) -> Option<I>;
fn top(&self) -> Option<&I>;
fn top_mut(&mut self) -> Option<&mut I>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Required Methods§
fn len(&self) -> usize
fn clear(&mut self)
fn push(&mut self, u: I)
fn pop(&mut self) -> Option<I>
fn top(&self) -> Option<&I>
fn top_mut(&mut self) -> Option<&mut I>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".