pub trait Stack<A> {
// Required methods
fn cons(self, value: A) -> Self;
fn head(&self) -> Result<&A, StackError>;
fn tail(&self) -> Rc<Self>;
fn size(&self) -> usize;
fn update(self, index: u32, new_value: A) -> Result<Self, StackError>
where Self: Sized;
fn get(&self, i: u32) -> Result<&A, StackError>;
}
Required Methods§
fn cons(self, value: A) -> Self
fn head(&self) -> Result<&A, StackError>
fn tail(&self) -> Rc<Self>
fn size(&self) -> usize
fn update(self, index: u32, new_value: A) -> Result<Self, StackError>where
Self: Sized,
fn get(&self, i: u32) -> Result<&A, StackError>
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.