Struct rand_xorshift::XorShiftRng
source · [−]pub struct XorShiftRng { /* private fields */ }
Expand description
An Xorshift random number generator.
The Xorshift1 algorithm is not suitable for cryptographic purposes
but is very fast. If you do not know for sure that it fits your
requirements, use a more secure one such as StdRng
or OsRng
.
Marsaglia, George (July 2003). “Xorshift RNGs”. Journal of Statistical Software. Vol. 8 (Issue 14). ↩
Trait Implementations
sourceimpl Clone for XorShiftRng
impl Clone for XorShiftRng
sourcefn clone(&self) -> XorShiftRng
fn clone(&self) -> XorShiftRng
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for XorShiftRng
impl Debug for XorShiftRng
sourceimpl RngCore for XorShiftRng
impl RngCore for XorShiftRng
sourceimpl SeedableRng for XorShiftRng
impl SeedableRng for XorShiftRng
type Seed = [u8; 16]
type Seed = [u8; 16]
Seed type, which is restricted to types mutably-dereferencable as u8
arrays (we recommend [u8; N]
for some N
). Read more
sourcefn from_rng<R: RngCore>(rng: R) -> Result<Self, Error>
fn from_rng<R: RngCore>(rng: R) -> Result<Self, Error>
Create a new PRNG seeded from another Rng
. Read more
sourcefn seed_from_u64(state: u64) -> Self
fn seed_from_u64(state: u64) -> Self
Create a new PRNG using a u64
seed. Read more
Auto Trait Implementations
impl RefUnwindSafe for XorShiftRng
impl Send for XorShiftRng
impl Sync for XorShiftRng
impl Unpin for XorShiftRng
impl UnwindSafe for XorShiftRng
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more