Skip to main content

EntropyConcreteGenerator

Trait EntropyConcreteGenerator 

Source
pub trait EntropyConcreteGenerator<TGenerator: EntropyGenerator>: Sized + ReprC {
    // Required method
    fn generate(generator: &mut TGenerator) -> Result<Self, TGenerator::Error>;
}
Expand description

Generates random type based on surrounding entropy, i.e. based on what the operating system provides as “true” randomness.

Similar to EntropyGenerator but works with a single type only.

Required Methods§

Source

fn generate(generator: &mut TGenerator) -> Result<Self, TGenerator::Error>

Generates a new random instance of itself.

§Errors

The same as EntropyGenerator::Error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for i16

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for i32

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for i64

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for i128

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for isize

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for u16

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for u32

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for u64

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for u128

Source§

impl EntropyConcreteGenerator<StdEntropyGenerator> for usize

Source§

impl<const N: usize> EntropyConcreteGenerator<StdEntropyGenerator> for [u8; N]

Implementors§