Struct mut_binary_heap::KeyComparator
source · pub struct KeyComparator<F>(pub F);
Expand description
The comparator ordered by key
Tuple Fields§
§0: F
Trait Implementations§
source§impl<F: Clone> Clone for KeyComparator<F>
impl<F: Clone> Clone for KeyComparator<F>
source§fn clone(&self) -> KeyComparator<F>
fn clone(&self) -> KeyComparator<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<K: Ord, T, F> Compare<T, T> for KeyComparator<F>where
F: Fn(&T) -> K,
impl<K: Ord, T, F> Compare<T, T> for KeyComparator<F>where F: Fn(&T) -> K,
source§fn compare(&self, a: &T, b: &T) -> Ordering
fn compare(&self, a: &T, b: &T) -> Ordering
Compares two values, returning
Less
, Equal
, or Greater
if l
is less
than, equal to, or greater than r
, respectively.source§fn borrowing(self) -> Borrowing<Self, L, R>where
Self: Sized,
fn borrowing(self) -> Borrowing<Self, L, R>where Self: Sized,
Borrows the comparator’s parameters before comparing them. Read more
source§fn rev(self) -> Rev<Self>where
Self: Sized,
fn rev(self) -> Rev<Self>where Self: Sized,
Reverses the ordering of the comparator. Read more
source§impl<F: Debug> Debug for KeyComparator<F>
impl<F: Debug> Debug for KeyComparator<F>
source§impl<F: Default> Default for KeyComparator<F>
impl<F: Default> Default for KeyComparator<F>
source§fn default() -> KeyComparator<F>
fn default() -> KeyComparator<F>
Returns the “default value” for a type. Read more
source§impl<F: PartialEq> PartialEq<KeyComparator<F>> for KeyComparator<F>
impl<F: PartialEq> PartialEq<KeyComparator<F>> for KeyComparator<F>
source§fn eq(&self, other: &KeyComparator<F>) -> bool
fn eq(&self, other: &KeyComparator<F>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.