Trait bolero_engine::ValueGenerator
source · pub trait ValueGenerator: Sized {
type Output;
// Required method
fn generate<D>(&self, driver: &mut D) -> Option<Self::Output>
where D: Driver;
// Provided methods
fn mutate<D>(&self, driver: &mut D, value: &mut Self::Output) -> Option<()>
where D: Driver { ... }
fn map<F, T>(self, map: F) -> MapGenerator<Self, F>
where F: Fn(Self::Output) -> T { ... }
fn map_gen<F, T>(self, map: F) -> MapGenerator<Self, F>
where F: Fn(Self::Output) -> T { ... }
fn and_then<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>
where F: Fn(Self::Output) -> T,
T: ValueGenerator { ... }
fn and_then_gen<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>
where F: Fn(Self::Output) -> T,
T: ValueGenerator { ... }
fn filter<F>(self, filter: F) -> FilterGenerator<Self, F>
where F: Fn(&Self::Output) -> bool { ... }
fn filter_gen<F>(self, filter: F) -> FilterGenerator<Self, F>
where F: Fn(&Self::Output) -> bool { ... }
fn filter_map<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>
where F: Fn(Self::Output) -> Option<T> { ... }
fn filter_map_gen<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>
where F: Fn(Self::Output) -> Option<T> { ... }
}
Expand description
Generate a value with a parameterized generator
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn mutate<D>(&self, driver: &mut D, value: &mut Self::Output) -> Option<()>where
D: Driver,
fn mutate<D>(&self, driver: &mut D, value: &mut Self::Output) -> Option<()>where D: Driver,
Mutates an existing value with the given driver
sourcefn map<F, T>(self, map: F) -> MapGenerator<Self, F>where
F: Fn(Self::Output) -> T,
fn map<F, T>(self, map: F) -> MapGenerator<Self, F>where F: Fn(Self::Output) -> T,
Map the value of a generator
sourcefn map_gen<F, T>(self, map: F) -> MapGenerator<Self, F>where
F: Fn(Self::Output) -> T,
fn map_gen<F, T>(self, map: F) -> MapGenerator<Self, F>where F: Fn(Self::Output) -> T,
Map the value of a generator, exists to reduce conflicts with
other map
functions.
sourcefn and_then<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>where
F: Fn(Self::Output) -> T,
T: ValueGenerator,
fn and_then<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>where F: Fn(Self::Output) -> T, T: ValueGenerator,
Map the value of a generator with a new generator
sourcefn and_then_gen<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>where
F: Fn(Self::Output) -> T,
T: ValueGenerator,
fn and_then_gen<F, T>(self, and_then: F) -> AndThenGenerator<Self, F>where F: Fn(Self::Output) -> T, T: ValueGenerator,
Map the value of a generator with a new generator, exists to
reduce conflicts with other map
functions.
sourcefn filter<F>(self, filter: F) -> FilterGenerator<Self, F>where
F: Fn(&Self::Output) -> bool,
fn filter<F>(self, filter: F) -> FilterGenerator<Self, F>where F: Fn(&Self::Output) -> bool,
Filter the value of a generator
sourcefn filter_gen<F>(self, filter: F) -> FilterGenerator<Self, F>where
F: Fn(&Self::Output) -> bool,
fn filter_gen<F>(self, filter: F) -> FilterGenerator<Self, F>where F: Fn(&Self::Output) -> bool,
Filter the value of a generator, exists to
reduce conflicts with other filter
functions.
sourcefn filter_map<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>where
F: Fn(Self::Output) -> Option<T>,
fn filter_map<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>where F: Fn(Self::Output) -> Option<T>,
Filter the value of a generator and map it to something else
sourcefn filter_map_gen<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>where
F: Fn(Self::Output) -> Option<T>,
fn filter_map_gen<F, T>(self, filter_map: F) -> FilterMapGenerator<Self, F>where F: Fn(Self::Output) -> Option<T>,
Filter the value of a generator and map it to something else, exists to
reduce conflicts with other filter_map
functions.