Trait eclectic::seq::Stack [] [src]

pub trait Stack: PushBack + Remove {
    fn back(&self) -> Option<&Self::Item>;
    fn back_mut(&mut self) -> Option<&mut Self::Item>;
    fn pop_back(&mut self) -> Option<Self::Item>;
}

A stack.

Required Methods

fn back(&self) -> Option<&Self::Item>

Returns a reference to the item at the back of the stack.

Returns None if the stack is empty.

fn back_mut(&mut self) -> Option<&mut Self::Item>

Returns a mutable reference to the item at the back of the stack.

Returns None if the stack is empty.

fn pop_back(&mut self) -> Option<Self::Item>

Removes the item at the back of the stack and returns it.

Returns None if the stack is empty.

Implementors