List

Trait List 

Source
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§

Source

fn new() -> Self

Source

fn push_front(&mut self, data: T)

Source

fn push_back(&mut self, data: T)

Source

fn pop_front(&mut self) -> Result<T, &'static str>

Source

fn pop_back(&mut self) -> Result<T, &'static str>

Source

fn is_empty(&self) -> bool

Source

fn is_sorted(&self) -> bool

Source

fn get(&mut self, index: usize) -> Option<T>

Source

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.

Implementors§