[][src]Struct ordered_float::NotNaN

pub struct NotNaN<T: Float>(_);

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

A NaN value cannot be stored in this type.

Methods

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

Create a NotNaN value.

Returns Err if val is NaN

Create a NotNaN value from a value that is guaranteed to not be NaN

Behaviour is undefined if val is NaN

Get the value out.

Trait Implementations

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

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

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

Creates a NotNaN value from a Float.

Panics if the provided value is NaN or the computation results in NaN

Performs the conversion.

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

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

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

impl<T: Float> Sub<NotNaN<T>> for NotNaN<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: Float> Sub<T> for NotNaN<T>
[src]

Subtracts a float directly.

Panics if the provided value is NaN or the computation results in NaN

The resulting type after applying the - operator.

Performs the - operation.

impl<T: Float> Add<NotNaN<T>> for NotNaN<T>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T: Float> Add<T> for NotNaN<T>
[src]

Adds a float directly.

Panics if the provided value is NaN or the computation results in NaN

The resulting type after applying the + operator.

Performs the + operation.

impl<T: Float> Mul<NotNaN<T>> for NotNaN<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: Float> Mul<T> for NotNaN<T>
[src]

Multiplies a float directly.

Panics if the provided value is NaN or the computation results in NaN

The resulting type after applying the * operator.

Performs the * operation.

impl<T: Float> Div<NotNaN<T>> for NotNaN<T>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T: Float> Div<T> for NotNaN<T>
[src]

Divides a float directly.

Panics if the provided value is NaN or the computation results in NaN

The resulting type after applying the / operator.

Performs the / operation.

impl<T: Float> Rem<NotNaN<T>> for NotNaN<T>
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<T: Float> Rem<T> for NotNaN<T>
[src]

Calculates % with a float directly.

Panics if the provided value is NaN or the computation results in NaN

The resulting type after applying the % operator.

Performs the % operation.

impl<T: Float> Neg for NotNaN<T>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl AddAssign<NotNaN<f64>> for NotNaN<f64>
[src]

Performs the += operation.

impl AddAssign<NotNaN<f32>> for NotNaN<f32>
[src]

Performs the += operation.

impl AddAssign<f64> for NotNaN<f64>
[src]

Adds a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the += operation.

impl AddAssign<f32> for NotNaN<f32>
[src]

Adds a float directly.

Panics if the provided value is NaN.

Performs the += operation.

impl SubAssign<NotNaN<f64>> for NotNaN<f64>
[src]

Performs the -= operation.

impl SubAssign<NotNaN<f32>> for NotNaN<f32>
[src]

Performs the -= operation.

impl SubAssign<f64> for NotNaN<f64>
[src]

Subtracts a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the -= operation.

impl SubAssign<f32> for NotNaN<f32>
[src]

Subtracts a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the -= operation.

impl MulAssign<NotNaN<f64>> for NotNaN<f64>
[src]

Performs the *= operation.

impl MulAssign<NotNaN<f32>> for NotNaN<f32>
[src]

Performs the *= operation.

impl MulAssign<f64> for NotNaN<f64>
[src]

Multiplies a float directly.

Panics if the provided value is NaN.

Performs the *= operation.

impl MulAssign<f32> for NotNaN<f32>
[src]

Multiplies a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the *= operation.

impl DivAssign<NotNaN<f64>> for NotNaN<f64>
[src]

Performs the /= operation.

impl DivAssign<NotNaN<f32>> for NotNaN<f32>
[src]

Performs the /= operation.

impl DivAssign<f64> for NotNaN<f64>
[src]

Divides a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the /= operation.

impl DivAssign<f32> for NotNaN<f32>
[src]

Divides a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the /= operation.

impl RemAssign<NotNaN<f64>> for NotNaN<f64>
[src]

Performs the %= operation.

impl RemAssign<NotNaN<f32>> for NotNaN<f32>
[src]

Performs the %= operation.

impl RemAssign<f64> for NotNaN<f64>
[src]

Calculates %= with a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the %= operation.

impl RemAssign<f32> for NotNaN<f32>
[src]

Calculates %= with a float directly.

Panics if the provided value is NaN or the computation results in NaN

Performs the %= operation.

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

The resulting type after dereferencing.

Dereferences the value.

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

Serialize this value into the given Serde serializer. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

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

impl<T> Sync for NotNaN<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, Rhs, Output> NumOps for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T, Rhs> NumAssignOps for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

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