Struct ord_subset::OrdVar[][src]

pub struct OrdVar<T: PartialOrd + PartialEq>(_);

Wrapper to signal that the contained variables have a total order. It's illegal to compare two OrdVars that are not ordered. For this reason, it's unsafe to create OrdVars without checking. Checked constructors are available for OrdSubset types.

Panics

Panics when a.partial_cmp(b) returns None for two values a,b.

Methods

impl<T: PartialOrd + PartialEq> OrdVar<T>
[src]

Construct an OrdVar out of the argument.

Panics

Panics if the argument is outside of the total order.

Constructs an Option<OrdVar> out of the argument. Returns None if the argument is outside the total order.

Constructs an OrdVar without validity check. Incorrectly constructed OrdVars may panic on calls to .cmp(). The comparison operators (>, >=, =, !=, <, <=) will not panic but may result in surprising behaviour.

Trait Implementations

impl<T: PartialEq + PartialOrd + PartialEq> PartialEq for OrdVar<T>
[src]

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

This method tests for !=.

impl<T: PartialOrd + PartialOrd + PartialEq> PartialOrd for OrdVar<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Clone + PartialOrd + PartialEq> Clone for OrdVar<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Copy + PartialOrd + PartialEq> Copy for OrdVar<T>
[src]

impl<T: Debug + PartialOrd + PartialEq> Debug for OrdVar<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Hash + PartialOrd + PartialEq> Hash for OrdVar<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: PartialOrd + PartialEq> Eq for OrdVar<T>
[src]

impl<T: PartialOrd + PartialEq> Ord for OrdVar<T>
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<T: PartialOrd + PartialEq> Deref for OrdVar<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<T: PartialOrd + PartialEq> AsRef<T> for OrdVar<T>
[src]

Performs the conversion.

impl<T: Default + OrdSubset + Debug> Default for OrdVar<T>
[src]

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

Auto Trait Implementations

impl<T> Send for OrdVar<T> where
    T: Send

impl<T> Sync for OrdVar<T> where
    T: Sync