Struct smolprng::smol_core::PRNG[][src]

pub struct PRNG<T: Algorithm> { /* fields omitted */ }
Expand description

PRNG is the central pseudo-random number generating front end. This is the front end for the enture package.

Implementations

Implementation of the PRNG class over generic trait Algorithm

Can be used in the following ways.

let prng = PRNG{generator: JsfGenerator::default()};

let rand_bool = prng.gen_bool(); // Generates a random bool

let rand_u8 = prng.gen_u8();      //Generates a random u8
let rand_u16 = prng.gen_u16();    //Generates a random u16
let rand_u32 = prng.gen_u32();    //Generates a random u32
let rand_u64 = prng.gen_u64();    //Generates a random u64
let rand_u128 = prng.gen_u128();  //Generates a random u128

let rand_f32 = prng.gen_f32();    //Generates a random f32
let rand_f64 = prng.gen_f64();    //Generates a random f64

Generates a random bool based on Algorithm output

Generates a random u8 based on Algorithm output

generates a random unsigned integer of appropriate type from algorithm output

generates a random unsigned integer of appropriate type from algorithm output

generates a random unsigned integer of appropriate type from algorithm output

generates a random unsigned integer of appropriate type from algorithm output

Generates a random f64 uniformly distributed on [0,1)

Generates a random f32 uniformly distributed on [0,1)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.