Enum spinoso_securerandom::Max [−][src]
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]
.
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]
fn partial_cmp(&self, other: &Max) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,