EntropySource

Trait EntropySource 

Source
pub trait EntropySource: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn read_entropy(&self, buffer: &mut [u8]) -> usize;
    fn is_available(&self) -> bool;
}
Expand description

Trait for entropy sources that can provide random data

Required Methods§

Source

fn name(&self) -> &'static str

Get a name for this entropy source

Source

fn read_entropy(&self, buffer: &mut [u8]) -> usize

Read random bytes from this source

§Arguments
  • buffer - Buffer to fill with random data
§Returns

Number of bytes actually read

Source

fn is_available(&self) -> bool

Check if this source is available and ready

Implementors§