Skip to main content

HashMapGenerator

Struct HashMapGenerator 

Source
pub struct HashMapGenerator<K, V, L> { /* private fields */ }

Implementations§

Source§

impl<K: ValueGenerator, V: ValueGenerator, L> HashMapGenerator<K, V, L>

Source

pub fn keys<Gen: ValueGenerator<Output = K::Output>>( self, keys: Gen, ) -> HashMapGenerator<Gen, V, L>

Source

pub fn map_keys<Gen: ValueGenerator<Output = K::Output>, F: Fn(K) -> Gen>( self, map: F, ) -> HashMapGenerator<Gen, V, L>

Source

pub fn values<Gen: ValueGenerator<Output = V::Output>>( self, values: Gen, ) -> HashMapGenerator<K, Gen, L>

Source

pub fn map_values<Gen: ValueGenerator<Output = V::Output>, F: Fn(V) -> Gen>( self, map: F, ) -> HashMapGenerator<K, Gen, L>

Source

pub fn len<Gen: ValueGenerator<Output = usize>>( self, len: Gen, ) -> HashMapGenerator<K, V, Gen>

Source

pub fn map_len<Gen: ValueGenerator<Output = usize>, F: Fn(L) -> Gen>( self, map: F, ) -> HashMapGenerator<K, V, Gen>

Trait Implementations§

Source§

impl<K: ValueGenerator, V: ValueGenerator, L: ValueGenerator<Output = usize>> ValueGenerator for HashMapGenerator<K, V, L>
where K::Output: Sized + Hash + Eq,

Source§

type Output = HashMap<<K as ValueGenerator>::Output, <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 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
Source§

fn trace(self) -> Trace<Self>

Traces generated values to stderr

Auto Trait Implementations§

§

impl<K, V, L> Freeze for HashMapGenerator<K, V, L>
where K: Freeze, V: Freeze, L: Freeze,

§

impl<K, V, L> RefUnwindSafe for HashMapGenerator<K, V, L>

§

impl<K, V, L> Send for HashMapGenerator<K, V, L>
where K: Send, V: Send, L: Send,

§

impl<K, V, L> Sync for HashMapGenerator<K, V, L>
where K: Sync, V: Sync, L: Sync,

§

impl<K, V, L> Unpin for HashMapGenerator<K, V, L>
where K: Unpin, V: Unpin, L: Unpin,

§

impl<K, V, L> UnsafeUnpin for HashMapGenerator<K, V, L>

§

impl<K, V, L> UnwindSafe for HashMapGenerator<K, V, L>
where K: UnwindSafe, V: UnwindSafe, L: UnwindSafe,

Blanket Implementations§

Source§

impl<G> Any for G
where G: 'static + ValueGenerator,

Source§

fn any(&self) -> <G as ValueGenerator>::Output

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

Source§

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

Source§

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.