Trait traitgraph_algo::queue::BidirectedQueue
source · pub trait BidirectedQueue<T>: Default {
// Required methods
fn push_front(&mut self, t: T);
fn push_back(&mut self, t: T);
fn pop_front(&mut self) -> Option<T>;
fn pop_back(&mut self) -> Option<T>;
fn clear(&mut self);
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
A queue that supports both popping and pushing at front and back.
Required Methods§
sourcefn push_front(&mut self, t: T)
fn push_front(&mut self, t: T)
Insert an element at the front of the queue.