Struct bolero_generator::result::ResultGenerator

source ·
pub struct ResultGenerator<Ok, Err> { /* private fields */ }

Implementations§

source§

impl<Ok: ValueGenerator, Err: ValueGenerator> ResultGenerator<Ok, Err>

source

pub fn ok<Gen: ValueGenerator<Output = Ok::Output>>( self, gen: Gen, ) -> ResultGenerator<Gen, Err>

source

pub fn map_ok<Gen: ValueGenerator<Output = Ok::Output>, F: Fn(Ok) -> Gen>( self, map: F, ) -> ResultGenerator<Gen, Err>

source

pub fn err<Gen: ValueGenerator<Output = Err::Output>>( self, gen: Gen, ) -> ResultGenerator<Ok, Gen>

source

pub fn map_err<Gen: ValueGenerator<Output = Err::Output>, F: Fn(Err) -> Gen>( self, map: F, ) -> ResultGenerator<Ok, Gen>

Trait Implementations§

source§

impl<Ok: Clone, Err: Clone> Clone for ResultGenerator<Ok, Err>

source§

fn clone(&self) -> ResultGenerator<Ok, Err>

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<Ok: Debug, Err: Debug> Debug for ResultGenerator<Ok, Err>

source§

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

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

impl<Ok: ValueGenerator, Err: ValueGenerator> ValueGenerator for ResultGenerator<Ok, Err>

§

type Output = Result<<Ok as ValueGenerator>::Output, <Err 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 driver_cache<D: Driver>(&self, driver: &mut D, value: Self::Output)

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<Ok, Err> Freeze for ResultGenerator<Ok, Err>
where Ok: Freeze, Err: Freeze,

§

impl<Ok, Err> RefUnwindSafe for ResultGenerator<Ok, Err>
where Ok: RefUnwindSafe, Err: RefUnwindSafe,

§

impl<Ok, Err> Send for ResultGenerator<Ok, Err>
where Ok: Send, Err: Send,

§

impl<Ok, Err> Sync for ResultGenerator<Ok, Err>
where Ok: Sync, Err: Sync,

§

impl<Ok, Err> Unpin for ResultGenerator<Ok, Err>
where Ok: Unpin, Err: Unpin,

§

impl<Ok, Err> UnwindSafe for ResultGenerator<Ok, Err>
where Ok: UnwindSafe, Err: 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> 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,

§

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

§

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.