pub struct Splitmix64 { /* private fields */ }Expand description
Splitmix64 伪随机生成器(值语义,零堆分配)
适用于无安全要求的性能场景;安全场景必须使用 random_u64。
Implementations§
Source§impl Splitmix64
impl Splitmix64
Sourcepub const fn with_seed(seed: u64) -> Splitmix64
pub const fn with_seed(seed: u64) -> Splitmix64
以指定种子构造
Sourcepub fn seeded() -> Splitmix64
pub fn seeded() -> Splitmix64
以 CSPRNG 种子构造(应急回退同 random_u64)
Sourcepub fn next_bounded(&mut self, bound: u64) -> u64
pub fn next_bounded(&mut self, bound: u64) -> u64
生成 [0, bound) 区间伪随机数(bound 为 0 时返回 0)
Trait Implementations§
Source§impl Clone for Splitmix64
impl Clone for Splitmix64
Source§fn clone(&self) -> Splitmix64
fn clone(&self) -> Splitmix64
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Splitmix64
impl RefUnwindSafe for Splitmix64
impl Send for Splitmix64
impl Sync for Splitmix64
impl Unpin for Splitmix64
impl UnsafeUnpin for Splitmix64
impl UnwindSafe for Splitmix64
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