Struct thrift::OrderedFloat [−][src]
#[repr(transparent)]pub struct OrderedFloat<T>(pub T)
where
T: Float;
Expand description
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.
Tuple Fields
0: T
Implementations
Get the value out.
Trait Implementations
type Output = OrderedFloat<T>
type Output = OrderedFloat<T>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
returns the smallest finite number this type can represent
returns the largest finite number this type can represent
Returns the “default value” for a type. Read more
Mutably dereferences the value.
type Output = OrderedFloat<T>
type Output = OrderedFloat<T>
The resulting type after applying the /
operator.
Performs the /
operation. Read more
Performs the conversion.
Convert a &str to OrderedFloat
. Returns an error if the string fails to parse.
use ordered_float::OrderedFloat;
assert!("-10".parse::<OrderedFloat<f32>>().is_ok());
assert!("abc".parse::<OrderedFloat<f32>>().is_err());
assert!("NaN".parse::<OrderedFloat<f32>>().is_ok());
type Output = OrderedFloat<T>
type Output = OrderedFloat<T>
The resulting type after applying the *
operator.
Performs the *
operation. Read more
type Output = OrderedFloat<T>
type Output = OrderedFloat<T>
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
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
type Output = OrderedFloat<T>
type Output = OrderedFloat<T>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for OrderedFloat<T> where
T: RefUnwindSafe,
impl<T> Send for OrderedFloat<T> where
T: Send,
impl<T> Sync for OrderedFloat<T> where
T: Sync,
impl<T> Unpin for OrderedFloat<T> where
T: Unpin,
impl<T> UnwindSafe for OrderedFloat<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more