[][src]Struct ordered_float::OrderedFloat

pub struct OrderedFloat<T: Float>(pub T);

A wrapper around Floats providing an implementation of Ord and Hash.

NaN is sorted as greater than all other values and equal to itself, in contradiction with the IEEE standard.

Methods

impl<T: Float> OrderedFloat<T>
[src]

Get the value out.

Trait Implementations

impl<T: Float + PartialOrd> PartialOrd<OrderedFloat<T>> for OrderedFloat<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: Float + PartialEq> PartialEq<OrderedFloat<T>> for OrderedFloat<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: Default + Float> Default for OrderedFloat<T>
[src]

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

impl<T: Clone + Float> Clone for OrderedFloat<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Float> AsRef<T> for OrderedFloat<T>
[src]

Performs the conversion.

impl Into<f32> for OrderedFloat<f32>
[src]

Performs the conversion.

impl Into<f64> for OrderedFloat<f64>
[src]

Performs the conversion.

impl<T: Float + PartialOrd> Ord for OrderedFloat<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: Copy + Float> Copy for OrderedFloat<T>
[src]

impl<T: Float> From<T> for OrderedFloat<T>
[src]

Performs the conversion.

impl<T: Float + PartialEq> Eq for OrderedFloat<T>
[src]

impl<T: Float> AsMut<T> for OrderedFloat<T>
[src]

Performs the conversion.

impl<T: Float + Display> Display for OrderedFloat<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Debug + Float> Debug for OrderedFloat<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Float> Deref for OrderedFloat<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<T: Float> DerefMut for OrderedFloat<T>
[src]

Mutably dereferences the value.

impl<T: Float> Hash for OrderedFloat<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: Float + Serialize> Serialize for OrderedFloat<T>
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de, T: Float + Deserialize<'de>> Deserialize<'de> for OrderedFloat<T>
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]