Struct Xoshiro256PlusPlus

pub struct Xoshiro256PlusPlus { /* private fields */ }

A xoshiro256++ random number generator.

The xoshiro256++ algorithm is not suitable for cryptographic purposes, but is very fast and has excellent statistical properties.

The algorithm used here is translated from the xoshiro256plusplus.c reference source code by David Blackman and Sebastiano Vigna.

Trait Implementations

impl Clone for Xoshiro256PlusPlus

fn clone(&self) -> Xoshiro256PlusPlus

impl Debug for Xoshiro256PlusPlus

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for Xoshiro256PlusPlus

impl PartialEq for Xoshiro256PlusPlus

fn eq(&self, other: &Xoshiro256PlusPlus) -> bool

impl SeedableRng for Xoshiro256PlusPlus

type Seed = [u8; 32];
fn from_seed(seed: [u8; 32]) -> Xoshiro256PlusPlus

Create a new Xoshiro256PlusPlus. If seed is entirely 0, it will be mapped to a different seed.

fn seed_from_u64(state: u64) -> Self

Create a new Xoshiro256PlusPlus from a u64 seed.

This uses the SplitMix64 generator internally.

impl Serialize for Xoshiro256PlusPlus

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where
    __S: Serializer,

impl StructuralPartialEq for Xoshiro256PlusPlus

impl TryRng for Xoshiro256PlusPlus

type Error = Infallible;
fn try_next_u32(&mut self) -> Result<u32, Infallible>
fn try_next_u64(&mut self) -> Result<u64, Infallible>
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), Infallible>

impl<'de> Deserialize<'de> for Xoshiro256PlusPlus

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where
    __D: Deserializer<'de>,

Auto Trait Implementations

impl Freeze for Xoshiro256PlusPlus

impl RefUnwindSafe for Xoshiro256PlusPlus

impl Send for Xoshiro256PlusPlus

impl Sync for Xoshiro256PlusPlus

impl Unpin for Xoshiro256PlusPlus

impl UnsafeUnpin for Xoshiro256PlusPlus

impl UnwindSafe for Xoshiro256PlusPlus

Blanket Implementations

impl<R> Rng for Xoshiro256PlusPlus where R: TryRng<Error = Infallible> + ?Sized,

fn next_u32(&mut self) -> u32
fn next_u64(&mut self) -> u64
fn fill_bytes(&mut self, dst: &mut [u8])

impl<R> RngCore for Xoshiro256PlusPlus where R: Rng,

impl<R> RngExt for Xoshiro256PlusPlus where R: Rng + ?Sized,

impl<R> TryRngCore for Xoshiro256PlusPlus where R: TryRng,

type Error = <R as TryRng>::Error;

impl<T> Any for Xoshiro256PlusPlus where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Xoshiro256PlusPlus where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Xoshiro256PlusPlus where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Xoshiro256PlusPlus where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> DeserializeOwned for Xoshiro256PlusPlus where T: for<'de> Deserialize<'de>,

impl<T> From<T> for Xoshiro256PlusPlus

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Xoshiro256PlusPlus where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Xoshiro256PlusPlus where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Xoshiro256PlusPlus where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for Xoshiro256PlusPlus where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>