Struct compare::Borrowing
[−]
[src]
pub struct Borrowing<C, Lb: ?Sized, Rb: ?Sized = Lb>(_, _)
where
C: Compare<Lb, Rb>;
A comparator that borrows its parameters before comparing them.
See Compare::borrow
for an example.
Trait Implementations
impl<C, L: ?Sized, R: ?Sized, Lb: ?Sized, Rb: ?Sized> Compare<L, R> for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb>,
L: Borrow<Lb>,
R: Borrow<Rb>,
[src]
C: Compare<Lb, Rb>,
L: Borrow<Lb>,
R: Borrow<Rb>,
fn compare(&self, l: &L, r: &R) -> Ordering
Compares two values, returning Less
, Equal
, or Greater
if l
is less than, equal to, or greater than r
, respectively. Read more
fn compares_lt(&self, l: &L, r: &R) -> bool
Checks if l
is less than r
.
fn compares_le(&self, l: &L, r: &R) -> bool
Checks if l
is less than or equal to r
.
fn compares_ge(&self, l: &L, r: &R) -> bool
Checks if l
is greater than or equal to r
.
fn compares_gt(&self, l: &L, r: &R) -> bool
Checks if l
is greater than r
.
fn compares_eq(&self, l: &L, r: &R) -> bool
Checks if l
is equal to r
.
fn compares_ne(&self, l: &L, r: &R) -> bool
Checks if l
is not equal to r
.
fn borrowing(self) -> Borrowing<Self, L, R> where
Self: Sized,
Self: Sized,
Borrows the comparator's parameters before comparing them. Read more
fn rev(self) -> Rev<Self> where
Self: Sized,
Self: Sized,
Reverses the ordering of the comparator. Read more
fn swap(self) -> Swap<Self> where
Self: Sized,
Self: Sized,
Swaps the comparator's parameters, maintaining the underlying ordering. Read more
fn then<D>(self, then: D) -> Then<Self, D> where
D: Compare<L, R>,
Self: Sized,
D: Compare<L, R>,
Self: Sized,
Lexicographically combines the comparator with another. Read more
impl<C, Lb: ?Sized, Rb: ?Sized> Clone for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + Clone,
[src]
C: Compare<Lb, Rb> + Clone,
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<C, Lb: ?Sized, Rb: ?Sized> Copy for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + Copy,
[src]
C: Compare<Lb, Rb> + Copy,
impl<C, Lb: ?Sized, Rb: ?Sized> Default for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + Default,
[src]
C: Compare<Lb, Rb> + Default,
impl<C, Lb: ?Sized, Rb: ?Sized> PartialEq for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + PartialEq,
[src]
C: Compare<Lb, Rb> + PartialEq,
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<C, Lb: ?Sized, Rb: ?Sized> Eq for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + Eq,
[src]
C: Compare<Lb, Rb> + Eq,
impl<C, Lb: ?Sized, Rb: ?Sized> Debug for Borrowing<C, Lb, Rb> where
C: Compare<Lb, Rb> + Debug,
[src]
C: Compare<Lb, Rb> + Debug,