ItemStack

Trait ItemStack 

Source
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<'a, I, D> ItemStack<I> for &'a mut D
where 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>

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>

Implementors§