Struct prop_check_rs::gen::Gens
source · pub struct Gens;Expand description
Factory responsibility for generating Gens.
Genを生成するためのファクトリ責務。
Implementations§
source§impl Gens
impl Gens
sourcepub fn pure<B>(value: B) -> Gen<B>where
B: Clone + 'static,
pub fn pure<B>(value: B) -> Gen<B>where
B: Clone + 'static,
Generates a Gen that returns a value.
値を返すGenを生成します。
sourcepub fn pure_lazy<B, F>(f: F) -> Gen<B>where
F: Fn() -> B + 'static,
B: Clone + 'static,
pub fn pure_lazy<B, F>(f: F) -> Gen<B>where
F: Fn() -> B + 'static,
B: Clone + 'static,
Generates a Gen that returns a value from a function.
関数が返す値を返すGenを生成します。
sourcepub fn some<B>(gen: Gen<B>) -> Gen<Option<B>>where
B: Clone + 'static,
pub fn some<B>(gen: Gen<B>) -> Gen<Option<B>>where
B: Clone + 'static,
Generates a Gen that wraps the value of Gen into Option.
Genの値をOptionにラップするGenを生成します。
sourcepub fn option<B>(gen: Gen<B>) -> Gen<Option<B>>where
B: Debug + Clone + 'static,
pub fn option<B>(gen: Gen<B>) -> Gen<Option<B>>where
B: Debug + Clone + 'static,
Generates a Gen that returns Some or None based on the value of Gen.
Genの値を元にSomeもしくはNoneを返すGenを生成します。
sourcepub fn either<T, E>(gt: Gen<T>, ge: Gen<E>) -> Gen<Result<T, E>>where
T: Choose + Clone + 'static,
E: Clone + 'static,
pub fn either<T, E>(gt: Gen<T>, ge: Gen<E>) -> Gen<Result<T, E>>where
T: Choose + Clone + 'static,
E: Clone + 'static,
Generates a Gen that returns Either based on two Gens.
二つのGenを元にEitherを返すGenを生成します。
sourcepub fn frequency_values<B>(values: impl IntoIterator<Item = (u32, B)>) -> Gen<B>where
B: Debug + Clone + 'static,
pub fn frequency_values<B>(values: impl IntoIterator<Item = (u32, B)>) -> Gen<B>where
B: Debug + Clone + 'static,
Generates a Gen that produces values according to a specified ratio.
指定の比率によって値を生成するGenを生成します。
sourcepub fn frequency<B>(values: impl IntoIterator<Item = (u32, Gen<B>)>) -> Gen<B>where
B: Debug + Clone + 'static,
pub fn frequency<B>(values: impl IntoIterator<Item = (u32, Gen<B>)>) -> Gen<B>where
B: Debug + Clone + 'static,
Generates a Gen that produces a value based on the specified ratio and Gen.
指定された比率とGenに基づき値を生成するGenを生成します。
sourcepub fn list_of_n<B>(n: usize, gen: Gen<B>) -> Gen<Vec<B>>where
B: Clone + 'static,
pub fn list_of_n<B>(n: usize, gen: Gen<B>) -> Gen<Vec<B>>where
B: Clone + 'static,
Generates a Gen whose elements are the values generated by the specified number of Gen.
指定した個数のGenによって生成された値を要素とするGenを生成します。
sourcepub fn one<T: One>() -> Gen<T>
pub fn one<T: One>() -> Gen<T>
Generates a Gen that returns a single value of a certain type.
ある型の値を一つ返すGenを生成します。
sourcepub fn one_i64() -> Gen<i64>
pub fn one_i64() -> Gen<i64>
Generates a Gen that returns a single value of type i64.
i64型の値を一つ返すGenを生成します。
sourcepub fn one_u64() -> Gen<u64>
pub fn one_u64() -> Gen<u64>
Generates a Gen that returns a single value of type u64.
u64型の値を一つ返すGenを生成します。
sourcepub fn one_i32() -> Gen<i32>
pub fn one_i32() -> Gen<i32>
Generates a Gen that returns a single value of type i32.
i32型の値を一つ返すGenを生成します。
sourcepub fn one_u32() -> Gen<u32>
pub fn one_u32() -> Gen<u32>
Generates a Gen that returns a single value of type u32.
u32型の値を一つ返すGenを生成します。
sourcepub fn one_i16() -> Gen<i16>
pub fn one_i16() -> Gen<i16>
Generates a Gen that returns a single value of type i16.
i16型の値を一つ返すGenを生成します。
sourcepub fn one_u16() -> Gen<u16>
pub fn one_u16() -> Gen<u16>
Generates a Gen that returns a single value of type u16.
u16型の値を一つ返すGenを生成します。
sourcepub fn one_i8() -> Gen<i8>
pub fn one_i8() -> Gen<i8>
Generates a Gen that returns a single value of type i8.
i8型の値を一つ返すGenを生成します。
sourcepub fn one_u8() -> Gen<u8>
pub fn one_u8() -> Gen<u8>
Generates a Gen that returns a single value of type u8.
u8型の値を一つ返すGenを生成します。
sourcepub fn one_char() -> Gen<char>
pub fn one_char() -> Gen<char>
Generates a Gen that returns a single value of type char.
char型の値を一つ返すGenを生成します。
sourcepub fn one_bool() -> Gen<bool>
pub fn one_bool() -> Gen<bool>
Generates a Gen that returns a single value of type bool.
bool型の値を一つ返すGenを生成します。
sourcepub fn one_f64() -> Gen<f64>
pub fn one_f64() -> Gen<f64>
Generates a Gen that returns a single value of type f64.
f64型の値を一つ返すGenを生成します。
sourcepub fn one_f32() -> Gen<f32>
pub fn one_f32() -> Gen<f32>
Generates a Gen that returns a single value of type f32.
f32型の値を一つ返すGenを生成します。
sourcepub fn one_of<T: Choose + Clone + 'static>(
values: impl IntoIterator<Item = Gen<T>>
) -> Gen<T>
pub fn one_of<T: Choose + Clone + 'static>(
values: impl IntoIterator<Item = Gen<T>>
) -> Gen<T>
Generates a Gen that returns a value selected at random from a specified set of Gen.
指定されたGenの集合からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn one_of_values<T: Choose + Clone + 'static>(
values: impl IntoIterator<Item = T>
) -> Gen<T>
pub fn one_of_values<T: Choose + Clone + 'static>(
values: impl IntoIterator<Item = T>
) -> Gen<T>
Generates a Gen that returns one randomly selected value from the specified set of values.
指定された値の集合からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose<T: Choose>(min: T, max: T) -> Gen<T>
pub fn choose<T: Choose>(min: T, max: T) -> Gen<T>
Generates a Gen that returns one randomly selected value from the specified maximum and minimum ranges of generic type.
指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_char(min: char, max: char) -> Gen<char>
pub fn choose_char(min: char, max: char) -> Gen<char>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type char.
char型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_i64(min: i64, max: i64) -> Gen<i64>
pub fn choose_i64(min: i64, max: i64) -> Gen<i64>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type i64.
i64型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_u64(min: u64, max: u64) -> Gen<u64>
pub fn choose_u64(min: u64, max: u64) -> Gen<u64>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type u64.
u64型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_i32(min: i32, max: i32) -> Gen<i32>
pub fn choose_i32(min: i32, max: i32) -> Gen<i32>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type i32.
i32型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_u32(min: u32, max: u32) -> Gen<u32>
pub fn choose_u32(min: u32, max: u32) -> Gen<u32>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type u32.
u32型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_i16(min: i16, max: i16) -> Gen<i16>
pub fn choose_i16(min: i16, max: i16) -> Gen<i16>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type i16.
i16型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_u16(min: u16, max: u16) -> Gen<u16>
pub fn choose_u16(min: u16, max: u16) -> Gen<u16>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type u16.
u16型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_i8(min: i8, max: i8) -> Gen<i8>
pub fn choose_i8(min: i8, max: i8) -> Gen<i8>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type i8.
i8型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_u8(min: u8, max: u8) -> Gen<u8>
pub fn choose_u8(min: u8, max: u8) -> Gen<u8>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type u8.
u8型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_f64(min: f64, max: f64) -> Gen<f64>
pub fn choose_f64(min: f64, max: f64) -> Gen<f64>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type f64.
f64型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。
sourcepub fn choose_f32(min: f32, max: f32) -> Gen<f32>
pub fn choose_f32(min: f32, max: f32) -> Gen<f32>
Generates a Gen that returns one randomly selected value from a specified maximum and minimum range of type f32.
f32型の指定された最大・最小の範囲からランダムに一つ選択した値を返すGenを生成します。