Struct clampf::Clamp[][src]

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

A wrapper around a floating-point value clamped to the range [0,1].

Methods

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

Creates a new wrapper around the value without checking.

Safety

The value must be in the range [0,1].

Creates a new wrapper around the value.

Sets the contained value without checking.

Safety

The value must be in the range [0,1].

Sets the contained value.

Updates the contained value using a function without checking.

Safety

The value produced by a function must be in the range [0,1].

Updates the contained value using a function.

Returns the contained value.

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

impl<T: LowerExp + Float> LowerExp for Clamp<T>
[src]

Formats the value using the given formatter.

impl<T: UpperExp + Float> UpperExp for Clamp<T>
[src]

Formats the value using the given formatter.

impl<T: Float> Default for Clamp<T>
[src]

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

impl<T: Float> Bounded for Clamp<T>
[src]

returns the smallest finite number this type can represent

returns the largest finite number this type can represent

Auto Trait Implementations

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

impl<T> Sync for Clamp<T> where
    T: Sync