Struct ordered_float::OrderedFloat [] [src]

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]

[src]

Get the value out.

Trait Implementations

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

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

[src]

Formats the value using the given formatter. Read more

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

[src]

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

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

[src]

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

1.0.0
[src]

This method tests for !=.

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

[src]

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

1.3.0
[src]

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

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

[src]

Mutably dereferences the value.

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