pub trait PrioQueue: Queue {
// Provided methods
fn push_pop_front(&mut self, item: Self::Item) -> Self::Item
where Self: AddRemove { ... }
fn replace_front(&mut self, item: Self::Item) -> Option<Self::Item>
where Self: AddRemove { ... }
}Expand description
A priority queue.
Provided Methods§
Sourcefn push_pop_front(&mut self, item: Self::Item) -> Self::Itemwhere
Self: AddRemove,
fn push_pop_front(&mut self, item: Self::Item) -> Self::Itemwhere
Self: AddRemove,
Pushes the given item onto the queue, then removes the item at the front of the queue and returns it.
This method may be deprecated in favor of front_mut in the future.
Sourcefn replace_front(&mut self, item: Self::Item) -> Option<Self::Item>where
Self: AddRemove,
fn replace_front(&mut self, item: Self::Item) -> Option<Self::Item>where
Self: AddRemove,
Removes the item at the front of the queue, then pushes the given item onto the queue.
Returns the item that was removed, or None if the queue was empty.
This method may be deprecated in favor of front_mut in the future.
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.