Skip to main content

EntropySource

Trait EntropySource 

Source
pub trait EntropySource {
    // Required method
    fn fill(&mut self, destination: &mut [u8]) -> Result<(), Error>;
}
Expand description

A source of cryptographically secure random bytes.

Required Methods§

Source

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

Fill the destination or return before any protocol output is produced.

§Errors

Returns Error::EntropyUnavailable when the source cannot fill the entire destination with cryptographically secure random bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§