[][src]Trait bolero_generator::ValueGenerator

pub trait ValueGenerator: Sized {
    type Output;
    fn generate<R: Rng>(&self, rng: &mut R) -> Self::Output;

    fn map<F: Fn(Self::Output) -> T, T>(self, map: F) -> MapGenerator<Self, F> { ... }
fn and_then<F: Fn(Self::Output) -> T, T: ValueGenerator>(
        self,
        and_then: F
    ) -> AndThenGenerator<Self, F> { ... } }

Generate a value with a parameterized generator

Associated Types

type Output

Loading content...

Required methods

fn generate<R: Rng>(&self, rng: &mut R) -> Self::Output

Loading content...

Provided methods

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

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

Loading content...

Implementations on Foreign Types

impl ValueGenerator for String[src]

type Output = Self

impl ValueGenerator for bool[src]

type Output = bool

impl<T: TypeGenerator + BoundedValue> ValueGenerator for Range<T>[src]

type Output = T

impl<T: TypeGenerator + BoundedValue> ValueGenerator for RangeFrom<T>[src]

type Output = T

impl<T: TypeGenerator + BoundedValue> ValueGenerator for RangeInclusive<T>[src]

type Output = T

impl<T: TypeGenerator + BoundedValue> ValueGenerator for RangeTo<T>[src]

type Output = T

impl<T: TypeGenerator + BoundedValue> ValueGenerator for RangeToInclusive<T>[src]

type Output = T

impl ValueGenerator for char[src]

type Output = char

impl ValueGenerator for u8[src]

type Output = u8

impl ValueGenerator for i8[src]

type Output = i8

impl ValueGenerator for u16[src]

type Output = u16

impl ValueGenerator for i16[src]

type Output = i16

impl ValueGenerator for u32[src]

type Output = u32

impl ValueGenerator for i32[src]

type Output = i32

impl ValueGenerator for u64[src]

type Output = u64

impl ValueGenerator for i64[src]

type Output = i64

impl ValueGenerator for u128[src]

type Output = u128

impl ValueGenerator for i128[src]

type Output = i128

impl ValueGenerator for usize[src]

type Output = usize

impl ValueGenerator for isize[src]

type Output = isize

impl ValueGenerator for f32[src]

type Output = f32

impl ValueGenerator for f64[src]

type Output = f64

impl<A: ValueGenerator> ValueGenerator for (A,)[src]

type Output = (A::Output,)

impl<B: ValueGenerator, A: ValueGenerator> ValueGenerator for (A, B)[src]

type Output = (A::Output, B::Output)

impl<C: ValueGenerator, A: ValueGenerator, B: ValueGenerator> ValueGenerator for (A, B, C)[src]

type Output = (A::Output, B::Output, C::Output)

impl<D: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator> ValueGenerator for (A, B, C, D)[src]

type Output = (A::Output, B::Output, C::Output, D::Output)

impl<E: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator> ValueGenerator for (A, B, C, D, E)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output)

impl<F: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator> ValueGenerator for (A, B, C, D, E, F)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output)

impl<G: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output)

impl<H: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output)

impl<I: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output)

impl<J: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output)

impl<K: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output)

impl<L: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output)

impl<M: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output)

impl<N: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output)

impl<O: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output)

impl<P: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output)

impl<Q: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output)

impl<R: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output)

impl<S: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output)

impl<T: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output)

impl<U: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output)

impl<V: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator, U: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output, V::Output)

impl<W: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator, U: ValueGenerator, V: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output, V::Output, W::Output)

impl<X: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator, U: ValueGenerator, V: ValueGenerator, W: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output, V::Output, W::Output, X::Output)

impl<Y: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator, U: ValueGenerator, V: ValueGenerator, W: ValueGenerator, X: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output, V::Output, W::Output, X::Output, Y::Output)

impl<Z: ValueGenerator, A: ValueGenerator, B: ValueGenerator, C: ValueGenerator, D: ValueGenerator, E: ValueGenerator, F: ValueGenerator, G: ValueGenerator, H: ValueGenerator, I: ValueGenerator, J: ValueGenerator, K: ValueGenerator, L: ValueGenerator, M: ValueGenerator, N: ValueGenerator, O: ValueGenerator, P: ValueGenerator, Q: ValueGenerator, R: ValueGenerator, S: ValueGenerator, T: ValueGenerator, U: ValueGenerator, V: ValueGenerator, W: ValueGenerator, X: ValueGenerator, Y: ValueGenerator> ValueGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)[src]

type Output = (A::Output, B::Output, C::Output, D::Output, E::Output, F::Output, G::Output, H::Output, I::Output, J::Output, K::Output, L::Output, M::Output, N::Output, O::Output, P::Output, Q::Output, R::Output, S::Output, T::Output, U::Output, V::Output, W::Output, X::Output, Y::Output, Z::Output)

impl ValueGenerator for ()[src]

type Output = ()

impl<T> ValueGenerator for PhantomData<T>[src]

type Output = Self

Loading content...

Implementors

impl ValueGenerator for BooleanGenerator[src]

type Output = bool

impl<G: ValueGenerator, H: ValueGenerator, F: Fn(G::Output) -> H> ValueGenerator for AndThenGenerator<G, F>[src]

type Output = H::Output

impl<G: ValueGenerator, M: Fn(G::Output) -> T, T> ValueGenerator for MapGenerator<G, M>[src]

type Output = T

impl<K: ValueGenerator, V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for BTreeMapGenerator<K, V, L> where
    K::Output: Sized + Ord
[src]

type Output = BTreeMap<K::Output, V::Output>

impl<L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for StringGenerator<L>[src]

type Output = String

impl<Left: ValueGenerator, Right: ValueGenerator, Selector: ValueGenerator<Output = bool>> ValueGenerator for EitherGenerator<Left, Right, Selector>[src]

type Output = Either<Left::Output, Right::Output>

impl<Ok: ValueGenerator, Err: ValueGenerator, Selector: ValueGenerator<Output = bool>> ValueGenerator for ResultGenerator<Ok, Err, Selector>[src]

type Output = Result<Ok::Output, Err::Output>

impl<Seconds, Nanos> ValueGenerator for DurationGenerator<Seconds, Nanos> where
    Seconds: ValueGenerator<Output = u64>,
    Nanos: ValueGenerator<Output = u32>, 
[src]

type Output = Duration

impl<Start, End, T> ValueGenerator for RangeGenerator<Start, End> where
    Start: ValueGenerator<Output = T>,
    End: ValueGenerator<Output = T>, 
[src]

type Output = Range<T>

impl<Start, End, T> ValueGenerator for RangeInclusiveGenerator<Start, End> where
    Start: ValueGenerator<Output = T>,
    End: ValueGenerator<Output = T>, 
[src]

type Output = RangeInclusive<T>

impl<T: BoundedValue, G: ValueGenerator<Output = T>> ValueGenerator for BoundedGenerator<G, T>[src]

type Output = T

impl<T: TypeGenerator> ValueGenerator for TypeValueGenerator<T>[src]

type Output = T

impl<T: Clone> ValueGenerator for Constant<T>[src]

type Output = T

impl<V: ValueGenerator> ValueGenerator for BTreeSet<V> where
    V::Output: Sized + Ord
[src]

type Output = BTreeSet<V::Output>

impl<V: ValueGenerator> ValueGenerator for BinaryHeap<V> where
    V::Output: Sized + Ord
[src]

type Output = BinaryHeap<V::Output>

impl<V: ValueGenerator> ValueGenerator for LinkedList<V>[src]

type Output = LinkedList<V::Output>

impl<V: ValueGenerator> ValueGenerator for Vec<V>[src]

type Output = Vec<V::Output>

impl<V: ValueGenerator> ValueGenerator for VecDeque<V>[src]

type Output = VecDeque<V::Output>

impl<V: ValueGenerator, K: ValueGenerator> ValueGenerator for BTreeMap<K, V> where
    K::Output: Sized + Ord
[src]

type Output = BTreeMap<K::Output, V::Output>

impl<V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for BTreeSetGenerator<V, L> where
    V::Output: Sized + Ord
[src]

type Output = BTreeSet<V::Output>

impl<V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for BinaryHeapGenerator<V, L> where
    V::Output: Sized + Ord
[src]

type Output = BinaryHeap<V::Output>

impl<V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for LinkedListGenerator<V, L>[src]

type Output = LinkedList<V::Output>

impl<V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for VecDequeGenerator<V, L>[src]

type Output = VecDeque<V::Output>

impl<V: ValueGenerator, L: ValueGenerator<Output = Len>, Len: Into<usize>> ValueGenerator for VecGenerator<V, L>[src]

type Output = Vec<V::Output>

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

type Output = Option<V::Output>

Loading content...