Trait Queue

Source
pub trait Queue<T> {
    // Required methods
    fn with_capacity(capacity: usize) -> Self;
    fn len(&self) -> usize;
    fn push_back(&mut self, val: T);
    fn pop_front(&mut self) -> Option<T>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn with_capacity(capacity: usize) -> Self

Source

fn len(&self) -> usize

Source

fn push_back(&mut self, val: T)

Source

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

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Clone> Queue<T> for VecDeque<T>

Source§

fn len(&self) -> usize

Source§

fn with_capacity(capacity: usize) -> Self

Source§

fn push_back(&mut self, val: T)

Source§

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

Implementors§