Struct ordered_float::NotNaN [] [src]

pub struct NotNaN<T: Float + Copy>(pub T);

A wrapper around Floats providing an implementation of Ord.

If NaN is encountered because NotNaN was manually constructed with a NaN value, this will panic.

Methods

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

fn new(val: T) -> NotNaN<T>

Create a NotNaN value.

Panics

Panics if the val is NaN

fn as_ref(self) -> T

Get the value out.

Trait Implementations

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

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

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

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

fn clone(&self) -> NotNaN<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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

fn partial_cmp(&self, __arg_0: &NotNaN<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &NotNaN<T>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &NotNaN<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: &NotNaN<T>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &NotNaN<T>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Float + Copy + PartialOrd> Ord for NotNaN<T>
[src]

fn cmp(&self, other: &NotNaN<T>) -> Ordering

This method returns an Ordering between self and other. Read more

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

fn eq(&self, other: &NotNaN<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

This method tests for !=.

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