Trait EntropySource

Source
pub trait EntropySource {
    // Required method
    fn fill(&mut self, destination: &mut [u8]);

    // Provided method
    fn seed<T: FromRaw>(&mut self) -> T
       where Self: Sized { ... }
}
Expand description

This is a trait for entropy sources, used to produce seeds for RNGs.

Required Methods§

Source

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

Fills an array with random data.

§Arguments
  • destination: The buffer to fill with random data
§Panics

May panic if the entropy source is unavailable or broken.

Provided Methods§

Source

fn seed<T: FromRaw>(&mut self) -> T
where Self: Sized,

Generates an integer seed value.

returns: Integer seed

Implementors§