Skip to main content

EntropySource

Trait EntropySource 

Source
pub trait EntropySource: Send + Sync {
    // Required methods
    fn info(&self) -> &SourceInfo;
    fn is_available(&self) -> bool;
    fn collect(&self, n_samples: usize) -> Vec<u8> ;

    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn set_config(&self, _key: &str, _value: &str) -> Result<(), String> { ... }
    fn config_options(&self) -> Vec<(&'static str, String)> { ... }
}
Expand description

Trait that every entropy source must implement.

Required Methods§

Source

fn info(&self) -> &SourceInfo

Source metadata.

Source

fn is_available(&self) -> bool

Check if this source can operate on the current machine.

Source

fn collect(&self, n_samples: usize) -> Vec<u8>

Collect raw entropy samples. Returns a Vec<u8> of up to n_samples bytes.

Provided Methods§

Source

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

Convenience: name from info.

Source

fn set_config(&self, _key: &str, _value: &str) -> Result<(), String>

Optional runtime configuration. Returns Err if unsupported.

Source

fn config_options(&self) -> Vec<(&'static str, String)>

List configurable keys and their current values.

Implementors§

Source§

impl EntropySource for GPUDivergenceSource

Source§

impl EntropySource for IOSurfaceCrossingSource

Source§

impl EntropySource for NLInferenceTimingSource

Available on non-macOS only.
Source§

impl EntropySource for DiskIOSource

Source§

impl EntropySource for FsyncJournalSource

Source§

impl EntropySource for NvmeIokitSensorsSource

Source§

impl EntropySource for NvmePassthroughLinuxSource

Source§

impl EntropySource for NvmeRawDeviceSource

Source§

impl EntropySource for USBEnumerationSource

Available on non-macOS only.
Source§

impl EntropySource for KeychainTimingSource

Source§

impl EntropySource for KqueueEventsSource

Source§

impl EntropySource for MachIPCSource

Source§

impl EntropySource for PipeBufferSource

Source§

impl EntropySource for AMXTimingSource

Source§

impl EntropySource for APRRJitTimingSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for CASContentionSource

Source§

impl EntropySource for CntfrqCacheTimingSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for CommonCryptoAesTimingSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for DVFSRaceSource

Source§

impl EntropySource for DenormalTimingSource

Source§

impl EntropySource for DualClockDomainSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for GxfRegisterTimingSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for ICCAtomicContentionSource

Source§

impl EntropySource for MemoryBusCryptoSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for PrefetcherStateSource

Available on non-macOS only.
Source§

impl EntropySource for SEVEventTimingSource

Available on not (macOS and AArch64).
Source§

impl EntropySource for SITVASource

Available on not (macOS and AArch64).
Source§

impl EntropySource for SpeculativeExecutionSource

Source§

impl EntropySource for TLBShootdownSource

Source§

impl EntropySource for DNSTimingSource

Source§

impl EntropySource for TCPConnectSource

Source§

impl EntropySource for WiFiRSSISource

Source§

impl EntropySource for QCicadaSource

Source§

impl EntropySource for DispatchQueueTimingSource

Available on non-macOS only.
Source§

impl EntropySource for PECoreArithmeticSource

Source§

impl EntropySource for PreemptionBoundarySource

Available on not (macOS and AArch64).
Source§

impl EntropySource for SleepJitterSource

Source§

impl EntropySource for ThreadLifecycleSource

Source§

impl EntropySource for TimerCoalescingSource

Source§

impl EntropySource for AudioNoiseSource

Source§

impl EntropySource for BluetoothNoiseSource

Source§

impl EntropySource for CameraNoiseSource

Source§

impl EntropySource for SMCHighVarTimingSource

Available on non-macOS only.
Source§

impl EntropySource for CompressionTimingSource

Source§

impl EntropySource for HashTimingSource

Source§

impl EntropySource for SpotlightTimingSource

Source§

impl EntropySource for GetentropyTimingSource

Available on non-macOS only.
Source§

impl EntropySource for IORegistryEntropySource

Source§

impl EntropySource for ProcInfoTimingSource

Available on non-macOS only.
Source§

impl EntropySource for ProcessSource

Source§

impl EntropySource for SysctlSource

Source§

impl EntropySource for VmstatSource

Source§

impl EntropySource for AudioPLLTimingSource

Source§

impl EntropySource for CounterBeatSource

Source§

impl EntropySource for DisplayPllSource

Source§

impl EntropySource for PciePllSource

Source§

impl EntropySource for AneTimingSource

Source§

impl EntropySource for ClockJitterSource

Source§

impl EntropySource for CommPageClockTimingSource

Available on non-macOS only.
Source§

impl EntropySource for DRAMRowBufferSource

Source§

impl EntropySource for MachContinuousTimingSource

Available on non-macOS only.
Source§

impl EntropySource for MachTimingSource

Source§

impl EntropySource for PageFaultTimingSource