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: Clone> Clone for Swap<C>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<C: Copy> Copy for Swap<C>
[src]

impl<C: Default> Default for Swap<C>
[src]

Returns the "default value" for a type. Read more

impl<C: PartialEq> PartialEq for Swap<C>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<C: Eq> Eq for Swap<C>
[src]

impl<C: Debug> Debug for Swap<C>
[src]

Formats the value using the given formatter.

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

Compares two values, returning Less, Equal, or Greater if l is less than, equal to, or greater than r, respectively. Read more

Checks if l is less than r.

Checks if l is less than or equal to r.

Checks if l is greater than or equal to r.

Checks if l is greater than r.

Checks if l is equal to r.

Checks if l is not equal to r.

Borrows the comparator's parameters before comparing them. Read more

Reverses the ordering of the comparator. Read more

Swaps the comparator's parameters, maintaining the underlying ordering. Read more

Lexicographically combines the comparator with another. Read more