devela::all

Trait DataQueue

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

An abstract queue data type.

Required Methods§

Source

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

Remove an element from the (front of the) queue.

§Errors

Returns NotEnoughElements if there are not enough elements in the queue.

Source

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

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

§Errors

Returns NotEnoughSpace if there is not enough free space in the queue.

Implementors§

Source§

impl<T> DataQueue for VecDeque<T>

Source§

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

Source§

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

Source§

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

Source§

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