Trait Random

Source
pub trait Random {
    // Required methods
    fn random() -> Self;
    fn random_range_max(max: Self) -> Self;
    fn random_range(min: Self, max: Self) -> Self;
}
Expand description

Trait for generating random values

Required Methods§

Source

fn random() -> Self

Get a random value.

Source

fn random_range_max(max: Self) -> Self

Get a random value, expanded to another range.

Source

fn random_range(min: Self, max: Self) -> Self

Get a random value, expanded to another range.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Random for f32

Source§

fn random() -> Self

Source§

fn random_range_max(max: Self) -> Self

Source§

fn random_range(min: Self, max: Self) -> Self

Implementors§