pub struct Pcg<L, P, S, O> {
pub lcg: Lcg<L, S>,
pub output: PhantomData<(P, O)>,
}Fields§
§lcg: Lcg<L, S>§output: PhantomData<(P, O)>Implementations§
Source§impl<L, P, S, O> Pcg<L, P, S, O>
impl<L, P, S, O> Pcg<L, P, S, O>
pub fn with_parameters(seed: S, parameters: L) -> Self
pub fn current(&self) -> O
pub fn generate(&mut self) -> O
pub fn jump_forward(&mut self, steps: S) -> O
pub fn jump_backward(&mut self, steps: S) -> O
Trait Implementations§
Source§impl<L, P, S, O> SeedableRng for Pcg<L, P, S, O>
impl<L, P, S, O> SeedableRng for Pcg<L, P, S, O>
Source§type Seed = <S as Integer>::Bytes
type Seed = <S as Integer>::Bytes
Seed type, which is restricted to types mutably-dereferenceable as
u8
arrays (we recommend [u8; N] for some N). Read moreSource§fn seed_from_u64(state: u64) -> Self
fn seed_from_u64(state: u64) -> Self
Create a new PRNG using a
u64 seed. Read moreSource§fn from_rng(rng: &mut impl RngCore) -> Self
fn from_rng(rng: &mut impl RngCore) -> Self
Create a new PRNG seeded from an infallible
Rng. Read moreSource§fn try_from_rng<R>(rng: &mut R) -> Result<Self, <R as TryRngCore>::Error>where
R: TryRngCore,
fn try_from_rng<R>(rng: &mut R) -> Result<Self, <R as TryRngCore>::Error>where
R: TryRngCore,
Create a new PRNG seeded from a potentially fallible
Rng. Read moreimpl<L: Eq, P: Eq, S: Eq, O: Eq> Eq for Pcg<L, P, S, O>
impl<L, P, S, O> StructuralPartialEq for Pcg<L, P, S, O>
Auto Trait Implementations§
impl<L, P, S, O> Freeze for Pcg<L, P, S, O>
impl<L, P, S, O> RefUnwindSafe for Pcg<L, P, S, O>
impl<L, P, S, O> Send for Pcg<L, P, S, O>
impl<L, P, S, O> Sync for Pcg<L, P, S, O>
impl<L, P, S, O> Unpin for Pcg<L, P, S, O>
impl<L, P, S, O> UnwindSafe for Pcg<L, P, S, O>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.