pub struct KeyedReversePriorityQueue<K: Hash + Eq + Ord, P: Ord> {
items: KeyedPriorityQueue<K, ReverseOrdered<P>>,
}
Fields§
§items: KeyedPriorityQueue<K, ReverseOrdered<P>>
Implementations§
Source§impl<K, P> KeyedReversePriorityQueue<K, P>
impl<K, P> KeyedReversePriorityQueue<K, P>
pub fn new() -> KeyedReversePriorityQueue<K, P>
pub fn peek(&self) -> Option<(&K, &P)>
pub fn pop(&mut self) -> Option<(K, P)>
pub fn push(&mut self, key: K, priority: P) -> Option<P>
Sourcepub fn set_priority(
&mut self,
key: &K,
priority: P,
) -> Result<P, KeyedReversePriorityQueueUnknownKeyError>
pub fn set_priority( &mut self, key: &K, priority: P, ) -> Result<P, KeyedReversePriorityQueueUnknownKeyError>
Update the priority of a item (identified by key
) in the
priority queue.
§Errors
Err(KeyedReversePriorityQueue) is returned when the indicated key is not present.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<K, P> Debug for KeyedReversePriorityQueue<K, P>
impl<K, P> Debug for KeyedReversePriorityQueue<K, P>
Auto Trait Implementations§
impl<K, P> Freeze for KeyedReversePriorityQueue<K, P>
impl<K, P> RefUnwindSafe for KeyedReversePriorityQueue<K, P>where
P: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, P> Send for KeyedReversePriorityQueue<K, P>
impl<K, P> Sync for KeyedReversePriorityQueue<K, P>
impl<K, P> Unpin for KeyedReversePriorityQueue<K, P>
impl<K, P> UnwindSafe for KeyedReversePriorityQueue<K, P>where
P: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more