pub trait PlatformRandom {
// Required methods
fn random_u8() -> u8;
fn random_u16() -> u16;
fn random_u32() -> u32;
fn random_u64() -> u64;
fn random_fill(buf: *mut c_void, len: usize);
}Expand description
Pseudo-random number generation.
A simple xorshift32 PRNG is sufficient. Seed with hardware entropy (RNG peripheral, ADC noise, wall-clock time) during platform init.
Required Methods§
fn random_u8() -> u8
fn random_u16() -> u16
fn random_u32() -> u32
fn random_u64() -> u64
Sourcefn random_fill(buf: *mut c_void, len: usize)
fn random_fill(buf: *mut c_void, len: usize)
Fill buffer with random bytes.
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.