RngCore

Trait RngCore 

Source
pub trait RngCore: Rng {
    // Required methods
    fn next_u32(&mut self) -> u32;
    fn next_u64(&mut self) -> u64;
    fn fill_bytes(&mut self, dest: &mut [u8]);
    fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>;
}
Expand description

Compatibility trait with rand crate’s RngCore

This allows clock-rand RNGs to be used with the rand crate ecosystem.

Required Methods§

Source

fn next_u32(&mut self) -> u32

Generate the next u32 random value

Source

fn next_u64(&mut self) -> u64

Generate the next u64 random value

Source

fn fill_bytes(&mut self, dest: &mut [u8])

Fill a byte buffer with random data

Source

fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>

Try to fill a byte buffer with random data (may fail)

Implementors§

Source§

impl<T: Rng> RngCore for T