pub struct StdEntropyGenerator(/* private fields */);
Expand description
The standard entropy generator. It uses various os available operations to generate entropy:
macos
<- it utilizesgetentropy
syscalllinux
<- it utilizesgetrandom
syscallwindows
<- it utilizesProcessPrng
syscall
Other platforms are not supported at the moment.
Implementations§
Source§impl StdEntropyGenerator
impl StdEntropyGenerator
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new instance of StdEntropyGenerator
. This
method is basically free.
Trait Implementations§
Source§impl Clone for StdEntropyGenerator
impl Clone for StdEntropyGenerator
Source§fn clone(&self) -> StdEntropyGenerator
fn clone(&self) -> StdEntropyGenerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StdEntropyGenerator
impl Debug for StdEntropyGenerator
Source§impl Default for StdEntropyGenerator
impl Default for StdEntropyGenerator
Source§fn default() -> StdEntropyGenerator
fn default() -> StdEntropyGenerator
Returns the “default value” for a type. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for i16
impl EntropyConcreteGenerator<StdEntropyGenerator> for i16
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for i32
impl EntropyConcreteGenerator<StdEntropyGenerator> for i32
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for i64
impl EntropyConcreteGenerator<StdEntropyGenerator> for i64
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for isize
impl EntropyConcreteGenerator<StdEntropyGenerator> for isize
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for u16
impl EntropyConcreteGenerator<StdEntropyGenerator> for u16
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for u32
impl EntropyConcreteGenerator<StdEntropyGenerator> for u32
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for u64
impl EntropyConcreteGenerator<StdEntropyGenerator> for u64
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyConcreteGenerator<StdEntropyGenerator> for usize
impl EntropyConcreteGenerator<StdEntropyGenerator> for usize
Source§fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
fn generate(generator: &StdEntropyGenerator) -> Result<Self, StdEntropyError>
Generates a new random instance of itself. Read more
Source§impl EntropyGenerator for StdEntropyGenerator
impl EntropyGenerator for StdEntropyGenerator
Source§type Error = StdEntropyError
type Error = StdEntropyError
Represents a failure of entropy generation.
Source§unsafe fn fill_raw(
&self,
buffer_ptr: *mut u8,
buffer_len: usize,
) -> Result<(), Self::Error>
unsafe fn fill_raw( &self, buffer_ptr: *mut u8, buffer_len: usize, ) -> Result<(), Self::Error>
Fills raw ptr with randomness based on surrounding entropy. Read more
Source§impl ReprC for StdEntropyGenerator
impl ReprC for StdEntropyGenerator
impl Copy for StdEntropyGenerator
Auto Trait Implementations§
impl Freeze for StdEntropyGenerator
impl RefUnwindSafe for StdEntropyGenerator
impl Send for StdEntropyGenerator
impl Sync for StdEntropyGenerator
impl Unpin for StdEntropyGenerator
impl UnwindSafe for StdEntropyGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more