Skip to main content

EntropySource

Trait EntropySource 

Source
pub trait EntropySource:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn fill_bytes(&self, dest: &mut [u8]);
    fn next_u64(&self) -> u64;
    fn fork(&self, task_id: TaskId) -> Arc<dyn EntropySource>;
    fn source_id(&self) -> &'static str;
}
Expand description

Core trait for entropy providers.

Required Methods§

Source

fn fill_bytes(&self, dest: &mut [u8])

Fill a buffer with entropy bytes.

Source

fn next_u64(&self) -> u64

Return the next random u64.

Source

fn fork(&self, task_id: TaskId) -> Arc<dyn EntropySource>

Fork this entropy source deterministically for a child task.

Source

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

Stable identifier for tracing and diagnostics.

Implementors§