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§
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)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".