pub struct OptionGenerator<V, Selector> { /* private fields */ }

Implementations§

source§

impl<V: ValueGenerator, Selector: ValueGenerator<Output = bool>> OptionGenerator<V, Selector>

source

pub fn value<Gen: ValueGenerator<Output = V::Output>>( self, value: Gen ) -> OptionGenerator<Gen, Selector>

source

pub fn map_value<Gen: ValueGenerator<Output = V::Output>, F: Fn(V) -> Gen>( self, map: F ) -> OptionGenerator<Gen, Selector>

source

pub fn selector<Gen: ValueGenerator<Output = bool>>( self, selector: Gen ) -> OptionGenerator<V, Gen>

source

pub fn map_selector<Gen: ValueGenerator<Output = bool>, F: Fn(Selector) -> Gen>( self, map: F ) -> OptionGenerator<V, Gen>

Trait Implementations§

source§

impl<V: ValueGenerator, Selector: ValueGenerator<Output = bool>> ValueGenerator for OptionGenerator<V, Selector>

§

type Output = Option<<V as ValueGenerator>::Output>

source§

fn generate<D: Driver>(&self, driver: &mut D) -> Option<Self::Output>

Generates a value with the given driver
source§

fn mutate<D: Driver>( &self, driver: &mut D, value: &mut Self::Output ) -> Option<()>

Mutates an existing value with the given driver
source§

fn map_gen<F: Fn(Self::Output) -> T, T>(self, map: F) -> MapGenerator<Self, F>

Map the value of a generator
source§

fn and_then_gen<F: Fn(Self::Output) -> T, T: ValueGenerator>( self, and_then: F ) -> AndThenGenerator<Self, F>

Map the value of a generator with a new generator
source§

fn filter_gen<F: Fn(&Self::Output) -> bool>( self, filter: F ) -> FilterGenerator<Self, F>

Filter the value of a generator
source§

fn filter_map_gen<F: Fn(Self::Output) -> Option<T>, T>( self, filter_map: F ) -> FilterMapGenerator<Self, F>

Filter the value of a generator and map it to something else

Auto Trait Implementations§

§

impl<V, Selector> RefUnwindSafe for OptionGenerator<V, Selector>
where Selector: RefUnwindSafe, V: RefUnwindSafe,

§

impl<V, Selector> Send for OptionGenerator<V, Selector>
where Selector: Send, V: Send,

§

impl<V, Selector> Sync for OptionGenerator<V, Selector>
where Selector: Sync, V: Sync,

§

impl<V, Selector> Unpin for OptionGenerator<V, Selector>
where Selector: Unpin, V: Unpin,

§

impl<V, Selector> UnwindSafe for OptionGenerator<V, Selector>
where Selector: UnwindSafe, V: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.