Skip to main content

Rng

Trait Rng 

Source
pub trait Rng: Send + Sync {
    // Required method
    fn below(&mut self, max: u32) -> u32;
}
Expand description

A source of randomness for RFC 2782 weighted selection.

Injectable so the distribution is testable with a fixed seed; a test that cannot pin the randomness can only assert that selection did something.

Required Methods§

Source

fn below(&mut self, max: u32) -> u32

A value in 0..=max.

Implementors§