Struct compare::Borrow
[−]
[src]
pub struct Borrow<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, Lhs: ?Sized, Rhs: ?Sized, Lb: ?Sized, Rb: ?Sized> Compare<Lhs, Rhs> for Borrow<C, Lb, Rb> where C: Compare<Lb, Rb>, Lhs: StdBorrow<Lb>, Rhs: StdBorrow<Rb>[src]
fn compare(&self, lhs: &Lhs, rhs: &Rhs) -> Ordering
Compares two values, returning Less, Equal, or Greater if lhs is less than, equal to, or greater than rhs, respectively. Read more
fn compares_lt(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is less than rhs.
fn compares_le(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is less than or equal to rhs.
fn compares_ge(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is greater than or equal to rhs.
fn compares_gt(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is greater than rhs.
fn compares_eq(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is equal to rhs.
fn compares_ne(&self, lhs: &Lhs, rhs: &Rhs) -> bool
Checks if lhs is not equal to rhs.
fn borrow(self) -> Borrow<Self, Lhs, Rhs> where Self: Sized
Borrows the comparator's parameters before comparing them. Read more
fn rev(self) -> Rev<Self> where Self: Sized
Reverses the ordering of the comparator. Read more
fn swap(self) -> Swap<Self> where 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<Lhs, Rhs>, Self: Sized
Lexicographically combines the comparator with another. Read more
impl<C, Lb: ?Sized, Rb: ?Sized> Clone for Borrow<C, Lb, Rb> where C: Compare<Lb, Rb> + Clone[src]
fn clone(&self) -> Borrow<C, Lb, Rb>
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 Borrow<C, Lb, Rb> where C: Compare<Lb, Rb> + Copy[src]
impl<C, Lb: ?Sized, Rb: ?Sized> Default for Borrow<C, Lb, Rb> where C: Compare<Lb, Rb> + Default[src]
impl<C, Lb: ?Sized, Rb: ?Sized> PartialEq for Borrow<C, Lb, Rb> where C: Compare<Lb, Rb> + PartialEq[src]
fn eq(&self, other: &Borrow<C, Lb, Rb>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.