Skip to main content

Random

Trait Random 

Source
pub trait Random {
Show 14 methods // Required methods fn fork(&mut self) -> Self; fn next_i32(&mut self) -> i32; fn next_i32_bounded(&mut self, bound: i32) -> i32; fn next_i64(&mut self) -> i64; fn next_f32(&mut self) -> f32; fn next_f64(&mut self) -> f64; fn next_bool(&mut self) -> bool; fn next_gaussian(&mut self) -> f64; fn next_positional(&mut self) -> RandomSplitter; // Provided methods fn next_i32_between(&mut self, min: i32, max: i32) -> i32 { ... } fn next_i32_between_exclusive(&mut self, min: i32, max: i32) -> i32 { ... } fn triangle(&mut self, min: f64, max: f64) -> f64 { ... } fn triangle_f32(&mut self, min: f32, max: f32) -> f32 { ... } fn consume_count(&mut self, count: i32) { ... }
}
Expand description

A trait for random number generators.

Required Methods§

Source

fn fork(&mut self) -> Self

Source

fn next_i32(&mut self) -> i32

Source

fn next_i32_bounded(&mut self, bound: i32) -> i32

Source

fn next_i64(&mut self) -> i64

Source

fn next_f32(&mut self) -> f32

Source

fn next_f64(&mut self) -> f64

Source

fn next_bool(&mut self) -> bool

Source

fn next_gaussian(&mut self) -> f64

Source

fn next_positional(&mut self) -> RandomSplitter

Provided Methods§

Source

fn next_i32_between(&mut self, min: i32, max: i32) -> i32

Source

fn next_i32_between_exclusive(&mut self, min: i32, max: i32) -> i32

Source

fn triangle(&mut self, min: f64, max: f64) -> f64

Source

fn triangle_f32(&mut self, min: f32, max: f32) -> f32

Source

fn consume_count(&mut self, count: i32)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§