[][src]Struct ron::value::Float

pub struct Float(_);

A wrapper for f64, which guarantees that the inner value is finite and thus implements Eq, Hash and Ord.

Implementations

impl Float[src]

pub fn new(v: f64) -> Self[src]

Construct a new Float.

pub fn get(self) -> f64[src]

Returns the wrapped float.

Trait Implementations

impl Clone for Float[src]

impl Copy for Float[src]

impl Debug for Float[src]

impl Eq for Float[src]

Equality comparison In order to be able to use Float as a mapping key, NaN floating values wrapped in Float are equals to each other. It is not the case for underlying f64 values itself.

impl Hash for Float[src]

impl Ord for Float[src]

Ordering comparison In order to be able to use Float as a mapping key, NaN floating values wrapped in Float are equals to each other and are less then any other floating value. It is not the case for underlying f64 values itself. See the PartialEq implementation.

impl PartialEq<Float> for Float[src]

Partial equality comparison In order to be able to use Number as a mapping key, NaN floating values wrapped in Float are equals to each other. It is not the case for underlying f64 values itself.

impl PartialOrd<Float> for Float[src]

Partial ordering comparison In order to be able to use Number as a mapping key, NaN floating values wrapped in Number are equals to each other and are less then any other floating value. It is not the case for the underlying f64 values themselves.

use ron::value::Number;
assert!(Number::new(std::f64::NAN) < Number::new(std::f64::NEG_INFINITY));
assert_eq!(Number::new(std::f64::NAN), Number::new(std::f64::NAN));

Auto Trait Implementations

impl RefUnwindSafe for Float

impl Send for Float

impl Sync for Float

impl Unpin for Float

impl UnwindSafe for Float

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.