Skip to main content

EntropySourceFactory

Struct EntropySourceFactory 

Source
pub struct EntropySourceFactory;
Expand description

Entropy source factory

This factory provides convenient methods for creating different types of entropy sources based on requirements and platform capabilities.

Implementations§

Source§

impl EntropySourceFactory

Source

pub fn create_best_available() -> Result<Box<dyn EntropySource>>

Create the best available entropy source

This method attempts to create the highest quality entropy source available on the current platform.

Source

pub fn create_best_available_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>

Create the best available entropy source with configuration

This method attempts to create the highest quality entropy source available on the current platform that meets the specified requirements.

Source

pub fn create_os_entropy() -> Result<Box<dyn EntropySource>>

Create an OS entropy source

Source

pub fn create_os_entropy_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>

Create an OS entropy source with configuration

Source

pub fn create_hardware_entropy() -> Result<Box<dyn EntropySource>>

Create a hardware entropy source

Source

pub fn create_hardware_entropy_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>

Create a hardware entropy source with configuration

Source

pub fn create_deterministic_entropy(seed: [u8; 32]) -> Box<dyn EntropySource>

Create a deterministic entropy source (KT128 XOF from seed).

Source

pub fn create_deterministic_entropy_from_u64( seed: u64, ) -> Box<dyn EntropySource>

Create a deterministic entropy source from a u64 test seed (SplitMix64 → KT128).

Source

pub fn create_user_entropy(entropy_data: Vec<u8>) -> Box<dyn EntropySource>

Create a user entropy source

Source

pub fn create_user_entropy_with_quality( entropy_data: Vec<u8>, quality: f64, ) -> Box<dyn EntropySource>

Create a user entropy source with quality assessment

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.