[][src]Trait kernel::common::queue::Queue

pub trait Queue<T> {
    fn has_elements(&self) -> bool;
fn is_full(&self) -> bool;
fn len(&self) -> usize;
fn enqueue(&mut self, val: T) -> bool;
fn dequeue(&mut self) -> Option<T>;
fn empty(&mut self);
fn retain<F>(&mut self, f: F)
    where
        F: FnMut(&T) -> bool
; }

Required methods

fn has_elements(&self) -> bool

Returns true if there are any items in the queue, false otherwise.

fn is_full(&self) -> bool

Returns true if the queue is full, false otherwise.

fn len(&self) -> usize

Returns how many elements are in the queue.

fn enqueue(&mut self, val: T) -> bool

Add a new element to the back of the queue.

fn dequeue(&mut self) -> Option<T>

Remove the element from the front of the queue.

fn empty(&mut self)

Remove all elements from the ring buffer.

fn retain<F>(&mut self, f: F) where
    F: FnMut(&T) -> bool, 

Retains only the elements that satisfy the predicate.

Loading content...

Implementors

impl<'a, T: Copy> Queue<T> for RingBuffer<'a, T>[src]

Loading content...