Struct compare::Swap [] [src]

pub struct Swap<C>(_);

A comparator that swaps another's parameters, maintaining the underlying ordering.

This is useful for providing a comparator C: Compare<T, U> in a context that expects C: Compare<U, T>.

See Compare::swap for an example.

Trait Implementations

impl<C, L: ?Sized, R: ?Sized> Compare<R, L> for Swap<C> where C: Compare<L, R>

fn compare(&self, r: &R, l: &L) -> Ordering

fn compares_lt(&self, r: &R, l: &L) -> bool

fn compares_le(&self, r: &R, l: &L) -> bool

fn compares_ge(&self, r: &R, l: &L) -> bool

fn compares_gt(&self, r: &R, l: &L) -> bool

fn compares_eq(&self, r: &R, l: &L) -> bool

fn compares_ne(&self, r: &R, l: &L) -> bool

fn borrowing(self) -> Borrowing<Self, L, R> where Self: Sized

fn rev(self) -> Rev<Self> where Self: Sized

fn swap(self) -> Swap<Self> where Self: Sized

fn then<D>(self, then: D) -> Then<Self, D> where D: Compare<L, R>, Self: Sized

Derived Implementations

impl<C: Debug> Debug for Swap<C>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<C: Eq> Eq for Swap<C>

impl<C: PartialEq> PartialEq for Swap<C>

fn eq(&self, __arg_0: &Swap<C>) -> bool

fn ne(&self, __arg_0: &Swap<C>) -> bool

impl<C: Default> Default for Swap<C>

fn default() -> Swap<C>

impl<C: Copy> Copy for Swap<C>

impl<C: Clone> Clone for Swap<C>

fn clone(&self) -> Swap<C>

1.0.0fn clone_from(&mut self, source: &Self)