pub trait List<T: PartialOrd + Clone> {
// Required methods
fn new() -> Self;
fn push_front(&mut self, data: T);
fn push_back(&mut self, data: T);
fn pop_front(&mut self) -> Result<T, &'static str>;
fn pop_back(&mut self) -> Result<T, &'static str>;
fn is_empty(&self) -> bool;
fn is_sorted(&self) -> bool;
fn get(&mut self, index: usize) -> Option<T>;
fn len(&self) -> usize;
}Required Methods§
fn new() -> Self
fn push_front(&mut self, data: T)
fn push_back(&mut self, data: T)
fn pop_front(&mut self) -> Result<T, &'static str>
fn pop_back(&mut self) -> Result<T, &'static str>
fn is_empty(&self) -> bool
fn is_sorted(&self) -> bool
fn get(&mut self, index: usize) -> Option<T>
fn len(&self) -> usize
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.