pub struct DurationGenerator<Seconds, Nanos> { /* private fields */ }

Implementations§

source§

impl<Seconds, Nanos> DurationGenerator<Seconds, Nanos>
where Seconds: ValueGenerator<Output = u64>, Nanos: ValueGenerator<Output = u32>,

source

pub fn seconds<NewS: ValueGenerator<Output = u64>>( self, seconds: NewS ) -> DurationGenerator<NewS, Nanos>

source

pub fn map_seconds<NewS: ValueGenerator<Output = u64>, F: Fn(Seconds) -> NewS>( self, map: F ) -> DurationGenerator<NewS, Nanos>

source

pub fn nanos<NewE: ValueGenerator<Output = u32>>( self, nanos: NewE ) -> DurationGenerator<Seconds, NewE>

source

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>
where Seconds: ValueGenerator<Output = u64>, Nanos: ValueGenerator<Output = u32>,

§

type Output = Duration

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

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<Seconds, Nanos> RefUnwindSafe for DurationGenerator<Seconds, Nanos>
where Nanos: RefUnwindSafe, Seconds: RefUnwindSafe,

§

impl<Seconds, Nanos> Send for DurationGenerator<Seconds, Nanos>
where Nanos: Send, Seconds: Send,

§

impl<Seconds, Nanos> Sync for DurationGenerator<Seconds, Nanos>
where Nanos: Sync, Seconds: Sync,

§

impl<Seconds, Nanos> Unpin for DurationGenerator<Seconds, Nanos>
where Nanos: Unpin, Seconds: Unpin,

§

impl<Seconds, Nanos> UnwindSafe for DurationGenerator<Seconds, Nanos>
where Nanos: UnwindSafe, Seconds: 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.