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 PartialEq<XorShiftRng> for XorShiftRng
impl PartialEq<XorShiftRng> for XorShiftRng
sourcefn eq(&self, other: &XorShiftRng) -> bool
fn eq(&self, other: &XorShiftRng) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &XorShiftRng) -> bool
fn ne(&self, other: &XorShiftRng) -> bool
This method tests for !=
.
sourceimpl RngCore for XorShiftRng
impl RngCore for XorShiftRng
sourcefn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill dest
with random data. Read more
sourceimpl SeedableRng for XorShiftRng
impl SeedableRng for XorShiftRng
type Seed = [u8; 16]
type Seed = [u8; 16]
Seed type, which is restricted to types mutably-dereferenceable 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
sourcefn from_entropy() -> Self
fn from_entropy() -> Self
impl Eq for XorShiftRng
impl StructuralEq for XorShiftRng
impl StructuralPartialEq for XorShiftRng
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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more