pub struct RapidRng { /* private fields */ }
Expand description
A random number generator that uses the rapidhash mixing algorithm.
This deterministic RNG is optimised for speed and throughput. This is not a cryptographic random number generator.
This RNG is compatible with [rand_core::RngCore] and [rand_core::SeedableRng].
§Example
use rapidhash::RapidRng;
let mut rng = RapidRng::default();
println!("{}", rng.next());
Implementations§
Trait Implementations§
Source§impl Default for RapidRng
impl Default for RapidRng
Source§fn default() -> Self
fn default() -> Self
Create a new random number generator.
With std
enabled, the seed is generated using the current system time via rapidrng_time.
Without std
, the seed is set to RAPID_SEED.
Source§impl Ord for RapidRng
impl Ord for RapidRng
Source§impl PartialOrd for RapidRng
impl PartialOrd for RapidRng
impl Copy for RapidRng
impl Eq for RapidRng
impl StructuralPartialEq for RapidRng
Auto Trait Implementations§
impl Freeze for RapidRng
impl RefUnwindSafe for RapidRng
impl Send for RapidRng
impl Sync for RapidRng
impl Unpin for RapidRng
impl UnwindSafe for RapidRng
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more