prop_check_rs::rng

Struct RNG

Source
pub struct RNG { /* private fields */ }
Expand description

RNG is a random number generator. RNGは乱数生成器です。

Implementations§

Source§

impl RNG

Source

pub fn new() -> Self

new is a constructor.
newはファクトリです。

Source

pub fn with_seed(self, seed: u64) -> Self

new_with_seed is a constructor with seed.
new_with_seedはシード値を指定するファクトリです。

Source

pub fn i32_f32(&self) -> ((i32, f32), Self)

i32_f32 generates a tuple of i32 and f32.
i32_f32i32f32のタプルを生成します。

Source

pub fn f32_i32(&self) -> ((f32, i32), Self)

f32_i32 generates a tuple of f32 and i32.
f32_i32f32i32のタプルを生成します。

Source

pub fn f32_3(&self) -> ((f32, f32, f32), Self)

f32_3 generates a tuple of f32, f32 and f32.
f32_3f32f32f32のタプルを生成します。

Source

pub fn i32s(self, count: u32) -> (Vec<i32>, Self)

f32s generates a vector of f32.
f32sf32のベクタを生成します。

Source

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.
unitARNGのタプルを返す関数を生成します。

Source

pub fn sequence<A, F>(fs: Vec<F>) -> Box<dyn FnMut(RNG) -> (Vec<A>, RNG)>
where A: Clone + 'static, F: FnMut(RNG) -> (A, RNG) + 'static,

sequence generates a function that returns a tuple of Vec<A> and RNG.
sequenceVec<A>RNGのタプルを返す関数を生成します。

Source

pub fn int_value() -> Box<dyn FnMut(RNG) -> (i32, RNG)>

int_value generates a function that returns a tuple of i32 and RNG.
int_valuei32RNGのタプルを返す関数を生成します。

Source

pub fn double_value() -> Box<dyn FnMut(RNG) -> (f32, RNG)>

double_value generates a function that returns a tuple of f32 and RNG.
double_valuef32RNGのタプルを返す関数を生成します。

Source

pub fn map<A, B, F1, F2>(s: F1, f: F2) -> Box<dyn FnMut(RNG) -> (B, RNG)>
where F1: FnMut(RNG) -> (A, RNG) + 'static, F2: FnMut(A) -> B + 'static,

map generates a function that returns a tuple of B and RNG.
mapBRNGのタプルを返す関数を生成します。

Source

pub fn map2<F1, F2, F3, A, B, C>( ra: F1, rb: F2, f: F3, ) -> Box<dyn FnMut(RNG) -> (C, RNG)>
where F1: FnMut(RNG) -> (A, RNG) + 'static, F2: FnMut(RNG) -> (B, RNG) + 'static, F3: FnMut(A, B) -> C + 'static,

map2 generates a function that returns a tuple of C and RNG.
map2CRNGのタプルを返す関数を生成します。

Source

pub fn both<F1, F2, A, B>( ra: F1, rb: F2, ) -> Box<dyn FnMut(RNG) -> ((A, B), RNG)>
where F1: FnMut(RNG) -> (A, RNG) + 'static, F2: FnMut(RNG) -> (B, RNG) + 'static,

both generates a function that returns a tuple of (A, B) and RNG.
both(A, B)RNGのタプルを返す関数を生成します。

Source

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のタプルを返す関数を生成します。

Source

pub fn rand_double_int<'a>() -> Box<dyn FnMut(RNG) -> ((f32, i32), RNG)>

rand_double_int generates a function that returns a tuple of (f32, i32) and RNG.
rand_double_int(f32, i32)RNGのタプルを返す関数を生成します。

Source

pub fn flat_map<A, B, F, GF, BF>(f: F, g: GF) -> Box<dyn FnMut(RNG) -> (B, RNG)>
where F: FnMut(RNG) -> (A, RNG) + 'static, BF: FnMut(RNG) -> (B, RNG) + 'static, GF: FnMut(A) -> BF + 'static,

flat_map generates a function that returns a tuple of B and RNG.
flat_mapBRNGのタプルを返す関数を生成します。

Trait Implementations§

Source§

impl Clone for RNG

Source§

fn clone(&self) -> RNG

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RNG

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RNG

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl NextRandValue for RNG

Source§

fn next_i64(&self) -> (i64, Self)

next_i64 generates a tuple of i64 and Self.
next_i64i64Selfのタプルを生成します。
Source§

fn next_u64(&self) -> (u64, Self)

next_u64 generates a tuple of u64 and Self.
next_u64u64Selfのタプルを生成します。
Source§

fn next_i32(&self) -> (i32, Self)

next_i32 generates a tuple of i32 and Self.
next_i32i32Selfのタプルを生成します。
Source§

fn next_u32(&self) -> (u32, Self)

next_u32 generates a tuple of u32 and Self.
next_u32u32Selfのタプルを生成します。
Source§

fn next_i16(&self) -> (i16, Self)

next_i16 generates a tuple of i16 and Self.
next_i16i16Selfのタプルを生成します。
Source§

fn next_u16(&self) -> (u16, Self)

next_u16 generates a tuple of u16 and Self.
next_u16u16Selfのタプルを生成します。
Source§

fn next_i8(&self) -> (i8, Self)

next_i8 generates a tuple of i8 and Self.
next_i8i8Selfのタプルを生成します。
Source§

fn next_u8(&self) -> (u8, Self)

next_u8 generates a tuple of u8 and Self.
next_u8u8Selfのタプルを生成します。
Source§

fn next_f64(&self) -> (f64, Self)

next_f64 generates a tuple of f64 and Self.
next_f64f64Selfのタプルを生成します。
Source§

fn next_f32(&self) -> (f32, Self)

next_f32 generates a tuple of f32 and Self.
next_f32f32Selfのタプルを生成します。
Source§

fn next_bool(&self) -> (bool, Self)

next_bool generates a tuple of bool and Self.
next_boolboolSelfのタプルを生成します。
Source§

impl PartialEq for RNG

Source§

fn eq(&self, other: &RNG) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V