Skip to main content

SecureRandom

Trait SecureRandom 

Source
pub trait SecureRandom: SecureRandom {
    // Required methods
    fn fill(&self, dest: &mut [u8]) -> Result<(), Unspecified>;
    fn mut_fill(&mut self, dest: &mut [u8]) -> Result<(), Unspecified>;
}
Expand description

A secure random number generator.

Required Methods§

Source

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

Fills dest with random bytes.

§Errors

error::Unspecified if unable to fill dest.

Source

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

Available on crate feature dev-tests-only only.

Fills dest with random bytes.

This method is only available when the dev-tests-only feature is enabled.

§Errors

error::Unspecified if unable to fill dest.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> SecureRandom for T
where T: SecureRandom,