Struct decorum::ConstrainedFloat [] [src]

pub struct ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
{ /* fields omitted */ }

Constrained, ordered, hashable floating point proxy.

Wraps floating point values and provides a proxy that implements operation and numerical traits, including Hash, Ord, and Eq.

Methods

impl<T, P> ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

[src]

impl<T, P> ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Trait Implementations

impl<'a, T, P> Deserialize<'a> for ConstrainedFloat<T, P> where
    T: Deserialize<'a> + Float,
    P: FloatConstraint<T>, 
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl<T, P> Serialize for ConstrainedFloat<T, P> where
    T: Float + Serialize,
    P: FloatConstraint<T>, 
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<T, P> Clone for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>,
    T: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T, P> Copy for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>,
    T: Copy
[src]

impl<T, P> Debug for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>,
    T: Debug
[src]

[src]

Formats the value using the given formatter.

impl<T, P> Default for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>,
    T: Default
[src]

[src]

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

impl<T, P> AsRef<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the conversion.

impl<P> Into<f32> for ConstrainedFloat<f32, P> where
    P: FloatConstraint<f32>, 
[src]

[src]

Performs the conversion.

impl<P> Into<f64> for ConstrainedFloat<f64, P> where
    P: FloatConstraint<f64>, 
[src]

[src]

Performs the conversion.

impl<T, P> Add for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T, P> Add<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T, P> AddAssign for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the += operation.

impl<T, P> AddAssign<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the += operation.

impl<T, P> Bounded for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

returns the smallest finite number this type can represent

[src]

returns the largest finite number this type can represent

impl<T, P> Display for ConstrainedFloat<T, P> where
    T: Display + Float,
    P: FloatConstraint<T>, 
[src]

[src]

Formats the value using the given formatter. Read more

impl<T, P> Div for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<T, P> Div<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<T, P> DivAssign for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the /= operation.

impl<T, P> DivAssign<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the /= operation.

impl<T, P> Eq for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

impl<T, P> FloatConst for ConstrainedFloat<T, P> where
    T: Float + FloatConst,
    P: FloatConstraint<T>, 
[src]

[src]

Return Euler’s number.

[src]

Return Archimedes’ constant.

[src]

Return sqrt(2.0).

[src]

Return 1.0 / π.

[src]

Return 2.0 / π.

[src]

Return 1.0 / sqrt(2.0).

[src]

Return 2.0 / sqrt(π).

[src]

Return π / 2.0.

[src]

Return π / 3.0.

[src]

Return π / 4.0.

[src]

Return π / 6.0.

[src]

Return π / 8.0.

[src]

Return ln(10.0).

[src]

Return ln(2.0).

[src]

Return log10(e).

[src]

Return log2(e).

impl<T, P> FromPrimitive for ConstrainedFloat<T, P> where
    T: Float + FromPrimitive,
    P: FloatConstraint<T>, 
[src]

[src]

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, the None is returned. Read more

[src]

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

[src]

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

impl<T, P> Hash for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> Infinite for ConstrainedFloat<T, NotNanConstraint<T>> where
    T: Float
[src]

[src]

[src]

[src]

[src]

impl<T, P> Mul for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<T, P> Mul<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<T, P> MulAssign for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the *= operation.

impl<T, P> MulAssign<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the *= operation.

impl<T, P> Neg for ConstrainedFloat<T, P> where
    T: Float + Num,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl<T, P> Num for ConstrainedFloat<T, P> where
    T: Float + Num,
    P: FloatConstraint<T>, 
[src]

[src]

Convert from a string and radix <= 36. Read more

impl<T, P> NumCast for ConstrainedFloat<T, P> where
    T: Float + Num,
    P: FloatConstraint<T>, 
[src]

[src]

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. Read more

impl<T, P> One for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Returns the multiplicative identity element of Self, 1. Read more

impl<T, P> Ord for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

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

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<T, P> PartialEq for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<T, P> PartialOrd for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

impl<T, P> Real for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<T, P> Rem for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<T, P> Rem<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<T, P> RemAssign for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the %= operation.

impl<T, P> RemAssign<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the %= operation.

impl<T, P> Signed for ConstrainedFloat<T, P> where
    T: Float + Signed,
    P: FloatConstraint<T>, 
[src]

[src]

Computes the absolute value. Read more

[src]

The positive difference of two numbers. Read more

[src]

Returns the sign of the number. Read more

[src]

Returns true if the number is positive and false if the number is zero or negative.

[src]

Returns true if the number is negative and false if the number is zero or positive.

impl<T, P> Sub for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T, P> Sub<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T, P> SubAssign for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the -= operation.

impl<T, P> SubAssign<T> for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Performs the -= operation.

impl<T, P> ToPrimitive for ConstrainedFloat<T, P> where
    T: Float + ToPrimitive,
    P: FloatConstraint<T>, 
[src]

[src]

Converts the value of self to an i8.

[src]

Converts the value of self to an u8.

[src]

Converts the value of self to an i16.

[src]

Converts the value of self to an u16.

[src]

Converts the value of self to an i32.

[src]

Converts the value of self to an u32.

[src]

Converts the value of self to an i64.

[src]

Converts the value of self to an u64.

[src]

Converts the value of self to an isize.

[src]

Converts the value of self to a usize.

[src]

Converts the value of self to an f32.

[src]

Converts the value of self to an f64.

impl<T, P> Zero for ConstrainedFloat<T, P> where
    T: Float,
    P: FloatConstraint<T>, 
[src]

[src]

Returns the additive identity element of Self, 0. Read more

[src]

Returns true if self is equal to the additive identity.