devela::all

Trait DataDesta

Source
pub trait DataDesta: DataStack {
    // Required methods
    fn stack_pop_front(
        &mut self,
    ) -> Result<<Self as DataCollection>::Element, NotEnoughElements> ;
    fn stack_push_front(
        &mut self,
        element: <Self as DataCollection>::Element,
    ) -> Result<(), NotEnoughSpace> ;

    // Provided methods
    fn stack_pop_back(
        &mut self,
    ) -> Result<<Self as DataCollection>::Element, NotEnoughElements>  { ... }
    fn stack_push_back(
        &mut self,
        element: <Self as DataCollection>::Element,
    ) -> Result<(), NotEnoughSpace>  { ... }
}
Expand description

An abstract double-ended stack data type.

Required Methods§

Source

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

Remove an element from the front of the stack.

Source

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

Add an element to the front of the stack.

Provided Methods§

Source

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

Remove an element from the back of the stack (calls DataStack::stack_pop).

Source

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

Remove an element from the back of the stack (calls DataStack::stack_push).

Implementors§

Source§

impl<T> DataDesta for VecDeque<T>

Source§

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

Source§

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

Source§

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

Source§

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