Struct edn::OrderedFloat []

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

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> OrderedFloat<T> where
    T: Float

Get the value out.

Trait Implementations

impl<T> Clone for OrderedFloat<T> where
    T: Clone + Float

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Serialize for OrderedFloat<T> where
    T: Float + Serialize

Serialize this value into the given Serde serializer. Read more

impl<T> Hash for OrderedFloat<T> where
    T: Float

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

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

impl<T> Eq for OrderedFloat<T> where
    T: PartialEq<T> + Float

impl<T> Debug for OrderedFloat<T> where
    T: Debug + Float

Formats the value using the given formatter. Read more

impl<T> Copy for OrderedFloat<T> where
    T: Copy + Float

impl<T> PartialOrd<OrderedFloat<T>> for OrderedFloat<T> where
    T: PartialOrd<T> + Float

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> AsRef<T> for OrderedFloat<T> where
    T: Float

Important traits for &'a mut R

Performs the conversion.

impl<T> From<T> for OrderedFloat<T> where
    T: Float

Performs the conversion.

impl<T> DerefMut for OrderedFloat<T> where
    T: Float

Mutably dereferences the value.

impl Into<f64> for OrderedFloat<f64>

Performs the conversion.

impl Into<f32> for OrderedFloat<f32>

Performs the conversion.

impl<T> Ord for OrderedFloat<T> where
    T: PartialOrd<T> + Float

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<'de, T> Deserialize<'de> for OrderedFloat<T> where
    T: Float + Deserialize<'de>, 

Deserialize this value from the given Serde deserializer. Read more

impl<T> PartialEq<OrderedFloat<T>> for OrderedFloat<T> where
    T: PartialEq<T> + Float

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

This method tests for !=.

impl<T> Display for OrderedFloat<T> where
    T: Display + Float

Formats the value using the given formatter. Read more

impl<T> Deref for OrderedFloat<T> where
    T: Float

The resulting type after dereferencing.

Dereferences the value.

impl<T> Default for OrderedFloat<T> where
    T: Default + Float

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

impl<T> AsMut<T> for OrderedFloat<T> where
    T: Float

Important traits for &'a mut R

Performs the conversion.

Auto Trait Implementations

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

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