Trait queue_model::QueueModel[][src]

pub trait QueueModel {
    type Item;
    fn enqueue(&mut self, item: Self::Item) -> bool;
fn dequeue(&mut self) -> Option<Self::Item>;
fn is_empty(&self) -> bool; }

Trait which queue implementations must conform to.

Associated Types

type Item[src]

The type of items in the queue.

Loading content...

Required methods

fn enqueue(&mut self, item: Self::Item) -> bool[src]

Attempts to enqueue an item; returns whether or not it was successful.

fn dequeue(&mut self) -> Option<Self::Item>[src]

Attempts to dequeue an item; returns None if there are no items available.

fn is_empty(&self) -> bool[src]

Checks if the queue is empty.

Loading content...

Implementations on Foreign Types

impl<T> QueueModel for VecDeque<T>[src]

type Item = T

impl<T: Ord> QueueModel for BinaryHeap<T>[src]

type Item = T

Loading content...

Implementors

impl<T, const N: usize> QueueModel for StaticRingQueue<T, N>[src]

type Item = T

impl<T: Ord, const N: usize> QueueModel for StaticPriorityQueue<T, N>[src]

type Item = T

Loading content...