Struct edn::OrderedFloat
[−]
[src]
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,
[src]
impl<T> OrderedFloat<T> where
T: Float,
pub fn into_inner(self) -> T
[src]
pub fn into_inner(self) -> T
Get the value out.
Trait Implementations
impl<T> Clone for OrderedFloat<T> where
T: Clone + Float,
[src]
impl<T> Clone for OrderedFloat<T> where
T: Clone + Float,
fn clone(&self) -> OrderedFloat<T>
[src]
fn clone(&self) -> OrderedFloat<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Serialize for OrderedFloat<T> where
T: Float + Serialize,
[src]
impl<T> Serialize for OrderedFloat<T> where
T: Float + Serialize,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Hash for OrderedFloat<T> where
T: Float,
[src]
impl<T> Hash for OrderedFloat<T> where
T: Float,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> Eq for OrderedFloat<T> where
T: PartialEq<T> + Float,
[src]
impl<T> Eq for OrderedFloat<T> where
T: PartialEq<T> + Float,
impl<T> Debug for OrderedFloat<T> where
T: Debug + Float,
[src]
impl<T> Debug for OrderedFloat<T> where
T: Debug + Float,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> Copy for OrderedFloat<T> where
T: Copy + Float,
[src]
impl<T> Copy for OrderedFloat<T> where
T: Copy + Float,
impl<T> PartialOrd<OrderedFloat<T>> for OrderedFloat<T> where
T: PartialOrd<T> + Float,
[src]
impl<T> PartialOrd<OrderedFloat<T>> for OrderedFloat<T> where
T: PartialOrd<T> + Float,
fn partial_cmp(&self, __arg_0: &OrderedFloat<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, __arg_0: &OrderedFloat<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &OrderedFloat<T>) -> bool
[src]
fn lt(&self, __arg_0: &OrderedFloat<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &OrderedFloat<T>) -> bool
[src]
fn le(&self, __arg_0: &OrderedFloat<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &OrderedFloat<T>) -> bool
[src]
fn gt(&self, __arg_0: &OrderedFloat<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &OrderedFloat<T>) -> bool
[src]
fn ge(&self, __arg_0: &OrderedFloat<T>) -> bool
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,
[src]
impl<T> AsRef<T> for OrderedFloat<T> where
T: Float,
impl<T> From<T> for OrderedFloat<T> where
T: Float,
[src]
impl<T> From<T> for OrderedFloat<T> where
T: Float,
fn from(val: T) -> OrderedFloat<T>
[src]
fn from(val: T) -> OrderedFloat<T>
Performs the conversion.
impl<T> DerefMut for OrderedFloat<T> where
T: Float,
[src]
impl<T> DerefMut for OrderedFloat<T> where
T: Float,
fn deref_mut(&mut self) -> &mut <OrderedFloat<T> as Deref>::Target
[src]
fn deref_mut(&mut self) -> &mut <OrderedFloat<T> as Deref>::Target
Mutably dereferences the value.
impl Into<f64> for OrderedFloat<f64>
[src]
impl Into<f64> for OrderedFloat<f64>
impl Into<f32> for OrderedFloat<f32>
[src]
impl Into<f32> for OrderedFloat<f32>
impl<T> Ord for OrderedFloat<T> where
T: PartialOrd<T> + Float,
[src]
impl<T> Ord for OrderedFloat<T> where
T: PartialOrd<T> + Float,
fn cmp(&self, other: &OrderedFloat<T>) -> Ordering
[src]
fn cmp(&self, other: &OrderedFloat<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T> PartialEq<OrderedFloat<T>> for OrderedFloat<T> where
T: PartialEq<T> + Float,
[src]
impl<T> PartialEq<OrderedFloat<T>> for OrderedFloat<T> where
T: PartialEq<T> + Float,
fn eq(&self, other: &OrderedFloat<T>) -> bool
[src]
fn eq(&self, other: &OrderedFloat<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'de, T> Deserialize<'de> for OrderedFloat<T> where
T: Float + Deserialize<'de>,
[src]
impl<'de, T> Deserialize<'de> for OrderedFloat<T> where
T: Float + Deserialize<'de>,
fn deserialize<D>(
d: D
) -> Result<OrderedFloat<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(
d: D
) -> Result<OrderedFloat<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T> Display for OrderedFloat<T> where
T: Display + Float,
[src]
impl<T> Display for OrderedFloat<T> where
T: Display + Float,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> Deref for OrderedFloat<T> where
T: Float,
[src]
impl<T> Deref for OrderedFloat<T> where
T: Float,
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &<OrderedFloat<T> as Deref>::Target
[src]
fn deref(&self) -> &<OrderedFloat<T> as Deref>::Target
Dereferences the value.
impl<T> Default for OrderedFloat<T> where
T: Default + Float,
[src]
impl<T> Default for OrderedFloat<T> where
T: Default + Float,
fn default() -> OrderedFloat<T>
[src]
fn default() -> OrderedFloat<T>
Returns the "default value" for a type. Read more
impl<T> AsMut<T> for OrderedFloat<T> where
T: Float,
[src]
impl<T> AsMut<T> for OrderedFloat<T> where
T: Float,
Auto Trait Implementations
impl<T> Send for OrderedFloat<T> where
T: Send,
impl<T> Send for OrderedFloat<T> where
T: Send,
impl<T> Sync for OrderedFloat<T> where
T: Sync,
impl<T> Sync for OrderedFloat<T> where
T: Sync,