Skip to main content

RngCore

Trait RngCore 

Source
pub trait RngCore {
    // Required method
    fn try_fill_bytes(&mut self, destination: &mut [u8]) -> Result<(), Error>;

    // Provided methods
    fn next_u32(&mut self) -> u32 { ... }
    fn next_u64(&mut self) -> u64 { ... }
    fn fill_bytes(&mut self, destination: &mut [u8]) { ... }
}
Expand description

The byte-oriented randomness interface used by dcrypt.

Required Methods§

Source

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

Fill destination, propagating failures from the caller’s entropy source rather than silently substituting weak randomness.

Provided Methods§

Source

fn next_u32(&mut self) -> u32

Source

fn next_u64(&mut self) -> u64

Source

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<R: RngCore + ?Sized> RngCore for &mut R

Source§

fn next_u32(&mut self) -> u32

Source§

fn next_u64(&mut self) -> u64

Source§

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

Source§

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

Implementors§