devela::all

Trait DataStack

Source
pub trait DataStack: DataCollection {
    // Required methods
    fn stack_pop(
        &mut self,
    ) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ;
    fn stack_push(
        &mut self,
        element: <Self as DataCollection>::Element,
    ) -> Result<(), NotEnoughSpace> ;
}
Expand description

An abstract stack data type.

Required Methods§

Source

fn stack_pop( &mut self, ) -> Result<<Self as DataCollection>::Element, NotEnoughElements>

Remove an element from the (back of the) stack.

Source

fn stack_push( &mut self, element: <Self as DataCollection>::Element, ) -> Result<(), NotEnoughSpace>

Add an element to the (back of the) stack.

Implementors§

Source§

impl<T> DataStack for VecDeque<T>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Destaque<T, CAP, u8, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Destaque<T, CAP, u16, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Destaque<T, CAP, u32, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Destaque<T, CAP, usize, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Stack<T, CAP, u8, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Stack<T, CAP, u16, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Stack<T, CAP, u32, S>

Source§

impl<T, const CAP: usize, S: Storage> DataStack for Stack<T, CAP, usize, S>