[−][src]Struct pcg::Pcg
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]
fn next_u32(&mut self) -> u32
[src]
fn next_u64(&mut self) -> u64
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[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
fn from_seed(seed: Self::Seed) -> Pcg
[src]
fn seed_from_u64(state: u64) -> Self
[src]
fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
[src]
R: RngCore,
fn from_entropy() -> Self
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,