pub struct StreamRng { /* private fields */ }Expand description
A reproducible random-number stream: ChaCha20 (original 64-bit counter,
64-bit nonce layout) keyed by seed, with the stream id as the nonce.
Each stream has 2^64 blocks, far more than any simulation needs.
The output for a given (seed, stream) is part of the crate’s stability
contract; changing it requires a deliberate, documented version bump.
§Example
use prospicio_core::StreamRng;
let mut a = StreamRng::new(42, 7);
let mut b = StreamRng::new(42, 7);
assert_eq!(a.next_u64(), b.next_u64());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamRng
impl RefUnwindSafe for StreamRng
impl Send for StreamRng
impl Sync for StreamRng
impl Unpin for StreamRng
impl UnsafeUnpin for StreamRng
impl UnwindSafe for StreamRng
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