Skip to main content

RngWide

Struct RngWide 

Source
pub struct RngWide { /* private fields */ }
Available on not ((x86 or x86-64) and (target features sse2 or avx2 or avx512f)).
Expand description

Implements RomuTrio with 512-bit width.

Implementations§

Source§

impl RngWide

Source

pub fn new() -> Self

Available on non-crate feature unstable_simd only.

Creates a new RngWide with a seed from the best available randomness source.

Source

pub const fn from_seed_with_64bit(seeds: [u64; 8]) -> Self

Available on non-crate feature unstable_simd only.

Creates a new RngWide from the given eight 64-bit seeds.

The seeds should be from a high randomness source.

Source

pub const fn from_seed_with_192bit(seeds: [[u64; 3]; 8]) -> Self

Available on non-crate feature unstable_simd only.

Creates a new RngWide from the given eight 192-bit seeds.

The seeds should be from a high randomness source.

If the seeds are of low quality, user should call RngWide::mix() to improve the quality of the first couple of random numbers.

§Notice

The variables must be seeded such that at least one bit of state is non-zero.

Source

pub fn mix(&mut self)

Available on non-crate feature unstable_simd only.

Mixes the states, which should improve the quality of the random numbers.

Should be called when having (re-)seeded the generator with a fixed value of low randomness.

Source

pub fn seed(&mut self)

Available on non-crate feature unstable_simd only.

Re-seeds the RngWide from the best available randomness source.

Source

pub fn u64x8(&mut self) -> [u64; 8]

Available on non-crate feature unstable_simd only.

Generates eight random u64 values.

Source

pub fn fill_bytes(&mut self, slice: &mut [u8])

Available on non-crate feature unstable_simd only.

Fills a mutable [u8] slice with random values.

Trait Implementations§

Source§

impl Default for RngWide

Available on non-crate feature unstable_simd only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.