Randomable

Trait Randomable 

Source
pub trait Randomable: Sized {
    // Required methods
    fn rand() -> Self;
    fn randn(n: Self) -> Self;
    fn rand_range(min: Self, max: Self) -> Self;

    // Provided methods
    fn set_seed(s: u128) { ... }
    fn seed() -> u128 { ... }
}

Required Methods§

Source

fn rand() -> Self

Source

fn randn(n: Self) -> Self

Source

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

Provided Methods§

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 Randomable for f32

Source§

fn rand() -> f32

Source§

fn randn(n: f32) -> f32

Source§

fn rand_range(min: f32, max: f32) -> f32

Source§

impl Randomable for f64

Source§

fn rand() -> f64

Source§

fn randn(n: f64) -> f64

Source§

fn rand_range(min: f64, max: f64) -> f64

Source§

impl Randomable for i8

Source§

fn rand() -> i8

Source§

fn randn(n: i8) -> i8

Source§

fn rand_range(min: i8, max: i8) -> i8

Source§

impl Randomable for i16

Source§

fn rand() -> i16

Source§

fn randn(n: i16) -> i16

Source§

fn rand_range(min: i16, max: i16) -> i16

Source§

impl Randomable for i32

Source§

fn rand() -> i32

Source§

fn randn(n: i32) -> i32

Source§

fn rand_range(min: i32, max: i32) -> i32

Source§

impl Randomable for i64

Source§

fn rand() -> i64

Source§

fn randn(n: i64) -> i64

Source§

fn rand_range(min: i64, max: i64) -> i64

Source§

impl Randomable for i128

Source§

impl Randomable for isize

Source§

impl Randomable for u8

Source§

fn rand() -> u8

Source§

fn randn(n: u8) -> u8

Source§

fn rand_range(min: u8, max: u8) -> u8

Source§

impl Randomable for u16

Source§

fn rand() -> u16

Source§

fn randn(n: u16) -> u16

Source§

fn rand_range(min: u16, max: u16) -> u16

Source§

impl Randomable for u32

Source§

fn rand() -> u32

Source§

fn randn(n: u32) -> u32

Source§

fn rand_range(min: u32, max: u32) -> u32

Source§

impl Randomable for u64

Source§

fn rand() -> u64

Source§

fn randn(n: u64) -> u64

Source§

fn rand_range(min: u64, max: u64) -> u64

Source§

impl Randomable for u128

Source§

impl Randomable for usize

Implementors§