pub trait RandomSource {
// Required methods
fn roll_percent(&mut self) -> u8;
fn roll_below(&mut self, n: u32) -> u32;
}Expand description
Where game rules get their random numbers from.
Required Methods§
Sourcefn roll_percent(&mut self) -> u8
fn roll_percent(&mut self) -> u8
A uniform, unbiased integer in 0..=99.
Sourcefn roll_below(&mut self, n: u32) -> u32
fn roll_below(&mut self, n: u32) -> u32
A uniform, unbiased integer in 0..n. n must be at least 1; 0
gives 0.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".