pub trait Queue: Collection + Iter {
// Required methods
fn push(&mut self, item: Self::Item)
where Self: AddRemove;
fn front(&self) -> Option<&Self::Item>;
fn pop_front(&mut self) -> Option<Self::Item>
where Self: AddRemove;
}
Expand description
A queue.
Required Methods§
Sourcefn push(&mut self, item: Self::Item)where
Self: AddRemove,
fn push(&mut self, item: Self::Item)where
Self: AddRemove,
Pushes the given item onto the queue.
For FIFO queues, this pushes the item onto the back of the queue. For other queues, the location of the newly inserted item is unspecified.
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.