pub struct FnCmp<F>(pub F);Expand description
A wrapper of choosing function Fn(&D, &D) -> bool to implement Compare<D>.
Tuple Fields§
§0: FTrait Implementations§
Source§impl<D, F> Compare<D> for FnCmp<F>
impl<D, F> Compare<D> for FnCmp<F>
Source§fn compare(&self, l: &D, r: &D) -> Ordering
fn compare(&self, l: &D, r: &D) -> 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
Auto Trait Implementations§
impl<F> Freeze for FnCmp<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnCmp<F>where
F: RefUnwindSafe,
impl<F> Send for FnCmp<F>where
F: Send,
impl<F> Sync for FnCmp<F>where
F: Sync,
impl<F> Unpin for FnCmp<F>where
F: Unpin,
impl<F> UnwindSafe for FnCmp<F>where
F: 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