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§

source

fn len(&self) -> usize

source

fn clear(&mut self)

source

fn push(&mut self, u: I)

source

fn pop(&mut self) -> Option<I>

source

fn top(&self) -> Option<&I>

source

fn top_mut(&mut self) -> Option<&mut I>

Provided Methods§

source

fn is_empty(&self) -> bool

Implementations on Foreign Types§

source§

impl<I> ItemStack<I> for Vec<I>

source§

fn is_empty(&self) -> bool

source§

fn len(&self) -> usize

source§

fn clear(&mut self)

source§

fn push(&mut self, u: I)

source§

fn pop(&mut self) -> Option<I>

source§

fn top(&self) -> Option<&I>

source§

fn top_mut(&mut self) -> Option<&mut I>

source§

impl<'a, I, D> ItemStack<I> for &'a mut Dwhere D: ItemStack<I>,

source§

fn is_empty(&self) -> bool

source§

fn len(&self) -> usize

source§

fn clear(&mut self)

source§

fn push(&mut self, u: I)

source§

fn pop(&mut self) -> Option<I>

source§

fn top(&self) -> Option<&I>

source§

fn top_mut(&mut self) -> Option<&mut I>

Implementors§