Struct seeded_random::Seed
source · pub struct Seed(/* private fields */);
Expand description
This encapsulates the RNG seed into a separate, uncopyable, and uncloneable value so it can not be accidentally propagated to another RNG without understanding the implication of reusing seeds.
Implementations§
source§impl Seed
impl Seed
sourcepub const fn unsafe_new(seed: u64) -> Self
pub const fn unsafe_new(seed: u64) -> Self
If you absolutely need to create a new seed from a raw value, use this function. It’s “unsafe” not because of memory reasons but because blindly reusing seed values can get you into tough-to-troubleshoot situations.
It’s better to generate new seeds and new RNGs from those seeds.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Seed
impl Send for Seed
impl Sync for Seed
impl Unpin for Seed
impl UnwindSafe for Seed
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