pub struct Prng { /* fields omitted */ }
A pseudorandom number generator.
The algorithms are based on this article by Bob Jenkins.
Creates a Prng
whose internal state is initialized with the given seed.
The result has a satisfying cycle length.
Creates a Prng
using the given byte array as internal state.
This function is a left and right inverse for Prng::to_bytes
.
A satisfying cycle length is only guaranteed for bytes from Prng::to_bytes
called
with an Prng
that has a satisfying cycle length. Other bytes should not be passed to this
function. For initializing an Prng
with an arbitrary seed, use Prng::from_seed
instead.
Returns the internal state as a byte array.
This function is a left and right inverse for Prng::from_bytes
.
Returns the next pseudorandom number.
Reinitialze the internal state of self using the current internal state and the given seed.
Splits off a new Prng
from self. The internal state of the new Prng
is generated with
self.
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Formats the value using the given formatter. Read more
Type of the hasher that will be created.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)