pub struct RNG { /* private fields */ }
Expand description
RNG
is a random number generator.
RNG
は乱数生成器です。
Implementations§
Source§impl RNG
impl RNG
Sourcepub fn with_seed(self, seed: u64) -> Self
pub fn with_seed(self, seed: u64) -> Self
new_with_seed
is a constructor with seed.
new_with_seed
はシード値を指定するファクトリです。
Sourcepub fn i32_f32(&self) -> ((i32, f32), Self)
pub fn i32_f32(&self) -> ((i32, f32), Self)
i32_f32
generates a tuple of i32
and f32
.
i32_f32
はi32
とf32
のタプルを生成します。
Sourcepub fn f32_i32(&self) -> ((f32, i32), Self)
pub fn f32_i32(&self) -> ((f32, i32), Self)
f32_i32
generates a tuple of f32
and i32
.
f32_i32
はf32
とi32
のタプルを生成します。
Sourcepub fn f32_3(&self) -> ((f32, f32, f32), Self)
pub fn f32_3(&self) -> ((f32, f32, f32), Self)
f32_3
generates a tuple of f32
, f32
and f32
.
f32_3
はf32
とf32
とf32
のタプルを生成します。
Sourcepub fn i32s(self, count: u32) -> (Vec<i32>, Self)
pub fn i32s(self, count: u32) -> (Vec<i32>, Self)
f32s
generates a vector of f32
.
f32s
はf32
のベクタを生成します。
Sourcepub fn unit<A>(a: A) -> Box<dyn FnMut(RNG) -> (A, RNG)>where
A: Clone + 'static,
pub fn unit<A>(a: A) -> Box<dyn FnMut(RNG) -> (A, RNG)>where
A: Clone + 'static,
unit
generates a function that returns a tuple of A
and RNG
.
unit
はA
とRNG
のタプルを返す関数を生成します。
Sourcepub fn sequence<A, F>(fs: Vec<F>) -> Box<dyn FnMut(RNG) -> (Vec<A>, RNG)>
pub fn sequence<A, F>(fs: Vec<F>) -> Box<dyn FnMut(RNG) -> (Vec<A>, RNG)>
sequence
generates a function that returns a tuple of Vec<A>
and RNG
.
sequence
はVec<A>
とRNG
のタプルを返す関数を生成します。
Sourcepub fn int_value() -> Box<dyn FnMut(RNG) -> (i32, RNG)>
pub fn int_value() -> Box<dyn FnMut(RNG) -> (i32, RNG)>
int_value
generates a function that returns a tuple of i32
and RNG
.
int_value
はi32
とRNG
のタプルを返す関数を生成します。
Sourcepub fn double_value() -> Box<dyn FnMut(RNG) -> (f32, RNG)>
pub fn double_value() -> Box<dyn FnMut(RNG) -> (f32, RNG)>
double_value
generates a function that returns a tuple of f32
and RNG
.
double_value
はf32
とRNG
のタプルを返す関数を生成します。
Sourcepub fn map<A, B, F1, F2>(s: F1, f: F2) -> Box<dyn FnMut(RNG) -> (B, RNG)>
pub fn map<A, B, F1, F2>(s: F1, f: F2) -> Box<dyn FnMut(RNG) -> (B, RNG)>
map
generates a function that returns a tuple of B
and RNG
.
map
はB
とRNG
のタプルを返す関数を生成します。
Sourcepub fn map2<F1, F2, F3, A, B, C>(
ra: F1,
rb: F2,
f: F3,
) -> Box<dyn FnMut(RNG) -> (C, RNG)>
pub fn map2<F1, F2, F3, A, B, C>( ra: F1, rb: F2, f: F3, ) -> Box<dyn FnMut(RNG) -> (C, RNG)>
map2
generates a function that returns a tuple of C
and RNG
.
map2
はC
とRNG
のタプルを返す関数を生成します。
Sourcepub fn both<F1, F2, A, B>(
ra: F1,
rb: F2,
) -> Box<dyn FnMut(RNG) -> ((A, B), RNG)>
pub fn both<F1, F2, A, B>( ra: F1, rb: F2, ) -> Box<dyn FnMut(RNG) -> ((A, B), RNG)>
both
generates a function that returns a tuple of (A, B)
and RNG
.
both
は(A, B)
とRNG
のタプルを返す関数を生成します。
Sourcepub fn rand_int_double() -> Box<dyn FnMut(RNG) -> ((i32, f32), RNG)>
pub fn rand_int_double() -> Box<dyn FnMut(RNG) -> ((i32, f32), RNG)>
rand_int_double
generates a function that returns a tuple of (i32, f32)
and RNG
.
rand_int_double
は(i32, f32)
とRNG
のタプルを返す関数を生成します。
Trait Implementations§
Source§impl NextRandValue for RNG
impl NextRandValue for RNG
Source§fn next_i64(&self) -> (i64, Self)
fn next_i64(&self) -> (i64, Self)
next_i64
generates a tuple of i64
and Self
.next_i64
はi64
とSelf
のタプルを生成します。Source§fn next_u64(&self) -> (u64, Self)
fn next_u64(&self) -> (u64, Self)
next_u64
generates a tuple of u64
and Self
.next_u64
はu64
とSelf
のタプルを生成します。Source§fn next_i32(&self) -> (i32, Self)
fn next_i32(&self) -> (i32, Self)
next_i32
generates a tuple of i32
and Self
.next_i32
はi32
とSelf
のタプルを生成します。Source§fn next_u32(&self) -> (u32, Self)
fn next_u32(&self) -> (u32, Self)
next_u32
generates a tuple of u32
and Self
.next_u32
はu32
とSelf
のタプルを生成します。Source§fn next_i16(&self) -> (i16, Self)
fn next_i16(&self) -> (i16, Self)
next_i16
generates a tuple of i16
and Self
.next_i16
はi16
とSelf
のタプルを生成します。Source§fn next_u16(&self) -> (u16, Self)
fn next_u16(&self) -> (u16, Self)
next_u16
generates a tuple of u16
and Self
.next_u16
はu16
とSelf
のタプルを生成します。Source§fn next_i8(&self) -> (i8, Self)
fn next_i8(&self) -> (i8, Self)
next_i8
generates a tuple of i8
and Self
.next_i8
はi8
とSelf
のタプルを生成します。Source§fn next_u8(&self) -> (u8, Self)
fn next_u8(&self) -> (u8, Self)
next_u8
generates a tuple of u8
and Self
.next_u8
はu8
とSelf
のタプルを生成します。Source§fn next_f64(&self) -> (f64, Self)
fn next_f64(&self) -> (f64, Self)
next_f64
generates a tuple of f64
and Self
.next_f64
はf64
とSelf
のタプルを生成します。impl StructuralPartialEq for RNG
Auto Trait Implementations§
impl Freeze for RNG
impl RefUnwindSafe for RNG
impl Send for RNG
impl Sync for RNG
impl Unpin for RNG
impl UnwindSafe for RNG
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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