Skip to main content

Queue

Trait Queue 

Source
pub trait Queue: Sized {
    type Event: Event;
    type Capacity: Count;
    type Vacancy<'a>: Vacancy<Event = Self::Event>
       where Self: 'a;

    // Required methods
    fn try_new(capacity: Self::Capacity) -> Result<Self, Error>;
    fn vacant(&mut self) -> Option<Self::Vacancy<'_>>;
    fn pop_front(&mut self) -> Option<Dequeued<Self::Event>>;
    fn suppress(&mut self, key: <Self::Event as Event>::Key);
    fn is_terminal(&self, key: <Self::Event as Event>::Key) -> bool;
    fn is_empty(&self) -> bool;
    fn available(&self) -> usize;
}

Required Associated Types§

Source

type Event: Event

Source

type Capacity: Count

Source

type Vacancy<'a>: Vacancy<Event = Self::Event>
where Self: 'a,

Required Methods§

Source

fn try_new(capacity: Self::Capacity) -> Result<Self, Error>

Source

fn vacant(&mut self) -> Option<Self::Vacancy<'_>>

Source

fn pop_front(&mut self) -> Option<Dequeued<Self::Event>>

Source

fn suppress(&mut self, key: <Self::Event as Event>::Key)

Source

fn is_terminal(&self, key: <Self::Event as Event>::Key) -> bool

Source

fn is_empty(&self) -> bool

Source

fn available(&self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§