pub struct Mt19937 { /* private fields */ }Implementations§
Source§impl Mt19937
impl Mt19937
Sourcepub fn from_seed_key(key: &[u32]) -> Self
pub fn from_seed_key(key: &[u32]) -> Self
CPython seeds every integer via init_by_array, never bare init_genrand — the seed
integer is first split into little-endian 32-bit words (key).
Sourcepub fn from_u64_seed(seed: u64) -> Self
pub fn from_u64_seed(seed: u64) -> Self
Seed from a small non-negative integer (as CPython does for random.Random(42) etc).
pub fn next_u32(&mut self) -> u32
Sourcepub fn getrandbits(&mut self, k: u32) -> u64
pub fn getrandbits(&mut self, k: u32) -> u64
CPython’s getrandbits(k): words filled least-significant-first, 32 bits at a time.
Auto Trait Implementations§
impl Freeze for Mt19937
impl RefUnwindSafe for Mt19937
impl Send for Mt19937
impl Sync for Mt19937
impl Unpin for Mt19937
impl UnsafeUnpin for Mt19937
impl UnwindSafe for Mt19937
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more