Struct bolero_generator::time::DurationGenerator
source · pub struct DurationGenerator<Seconds, Nanos> { /* private fields */ }
Implementations§
source§impl<Seconds, Nanos> DurationGenerator<Seconds, Nanos>
impl<Seconds, Nanos> DurationGenerator<Seconds, Nanos>
pub fn seconds<NewS: ValueGenerator<Output = u64>>( self, seconds: NewS ) -> DurationGenerator<NewS, Nanos>
pub fn map_seconds<NewS: ValueGenerator<Output = u64>, F: Fn(Seconds) -> NewS>( self, map: F ) -> DurationGenerator<NewS, Nanos>
pub fn nanos<NewE: ValueGenerator<Output = u32>>( self, nanos: NewE ) -> DurationGenerator<Seconds, NewE>
pub fn map_nanos<NewE: ValueGenerator<Output = u64>, F: Fn(Nanos) -> NewE>( self, map: F ) -> DurationGenerator<Seconds, NewE>
Trait Implementations§
source§impl<Seconds, Nanos> ValueGenerator for DurationGenerator<Seconds, Nanos>
impl<Seconds, Nanos> ValueGenerator for DurationGenerator<Seconds, Nanos>
type Output = Duration
source§fn generate<D: Driver>(&self, driver: &mut D) -> Option<Self::Output>
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 Duration) -> Option<()>
fn mutate<D: Driver>(&self, driver: &mut D, value: &mut Duration) -> 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>
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>
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>
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>
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<Seconds, Nanos> RefUnwindSafe for DurationGenerator<Seconds, Nanos>where
Nanos: RefUnwindSafe,
Seconds: RefUnwindSafe,
impl<Seconds, Nanos> Send for DurationGenerator<Seconds, Nanos>
impl<Seconds, Nanos> Sync for DurationGenerator<Seconds, Nanos>
impl<Seconds, Nanos> Unpin for DurationGenerator<Seconds, Nanos>
impl<Seconds, Nanos> UnwindSafe for DurationGenerator<Seconds, Nanos>where
Nanos: UnwindSafe,
Seconds: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more