Skip to main content

EntropySource

Trait EntropySource 

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

Injectable entropy source used only to make deterministic tests possible.

Required Methods§

Source

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

Fills the destination with cryptographically secure random bytes.

§Errors

Returns an error when secure entropy is unavailable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§