KeyedReversePriorityQueue

Struct KeyedReversePriorityQueue 

Source
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>
where K: Hash + Eq + Ord, P: Ord,

Source

pub fn new() -> KeyedReversePriorityQueue<K, P>

Source

pub fn peek(&self) -> Option<(&K, &P)>

Source

pub fn pop(&mut self) -> Option<(K, P)>

Source

pub fn push(&mut self, key: K, priority: P) -> Option<P>

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<K, P> Debug for KeyedReversePriorityQueue<K, P>
where K: Hash + Eq + Ord + Debug, P: Ord + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, P> Default for KeyedReversePriorityQueue<K, P>
where K: Hash + Eq + Ord, P: Ord,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<K, P> Freeze for KeyedReversePriorityQueue<K, P>

§

impl<K, P> RefUnwindSafe for KeyedReversePriorityQueue<K, P>

§

impl<K, P> Send for KeyedReversePriorityQueue<K, P>
where P: Send, K: Send,

§

impl<K, P> Sync for KeyedReversePriorityQueue<K, P>
where P: Sync, K: Sync,

§

impl<K, P> Unpin for KeyedReversePriorityQueue<K, P>
where P: Unpin, K: Unpin,

§

impl<K, P> UnwindSafe for KeyedReversePriorityQueue<K, P>
where P: UnwindSafe, K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.