Enum spinoso_securerandom::Max[][src]

pub enum Max {
    Float(f64),
    Integer(i64),
    None,
}

Max value when generating a random number from a range.

In Ruby, the rand family of functions generate random numbers form within a range. This range is always anchored on the left by zero. The Max enum allows callers to specify the upper bound of the range. If the None variant is given, the default is set to generate floats in the range of [0.0, 1.0).

Variants

Float(f64)

Generate floats in the range [0, max).

If max is less than or equal to zero, the range defaults to floats in [0.0, 1.0].

If max is NaN, an error is returned.

Integer(i64)

Generate signed integers in the range [0, max).

If max is less than or equal to zero, the range defaults to floats in [0.0, 1.0].

None

Generate floats in the range [0.0, 1.0].

Trait Implementations

impl Clone for Max[src]

impl Copy for Max[src]

impl Debug for Max[src]

impl PartialEq<Max> for Max[src]

impl PartialOrd<Max> for Max[src]

impl StructuralPartialEq for Max[src]

Auto Trait Implementations

impl RefUnwindSafe for Max

impl Send for Max

impl Sync for Max

impl Unpin for Max

impl UnwindSafe for Max

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]