[][src]Struct pcg::Pcg

pub struct Pcg { /* fields omitted */ }

The Pcg state struct contains state information for use by the random number generating functions.

The internals are private and shouldn't be modified by anything other than the member functions. Note that the random number generating functions will modify the state of this struct, so you must initialize Pcg as mutable in order to use any of its functionality.

Implementations

impl Pcg[src]

pub fn new(seed: u64, seq: u64) -> Pcg[src]

Constructs a new PCG state struct with a particular seed and sequence.

The function returns a struct with state information for the PCG RNG. The seed param supplies an initial state for the RNG, and the seq param functionally acts as a stream ID. If you're unsure of which params to initialize this struct with, construct the default struct.

If you can't think of a seed and a state to initialize this with, just use the default struct.

Examples

use pcg::Pcg;

let mut rng = Pcg::new(0, 0);

Trait Implementations

impl Clone for Pcg[src]

impl Debug for Pcg[src]

impl Default for Pcg[src]

impl Eq for Pcg[src]

impl PartialEq<Pcg> for Pcg[src]

impl RngCore for Pcg[src]

impl SeedableRng for Pcg[src]

type Seed = PcgSeed

Seed type, which is restricted to types mutably-dereferencable as u8 arrays (we recommend [u8; N] for some N). Read more

impl StructuralEq for Pcg[src]

impl StructuralPartialEq for Pcg[src]

Auto Trait Implementations

impl RefUnwindSafe for Pcg

impl Send for Pcg

impl Sync for Pcg

impl Unpin for Pcg

impl UnwindSafe for Pcg

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.