[][src]Trait un_algebra::tests::config::prop::arbitrary::functor::ArbitraryF1

pub trait ArbitraryF1<A>: Debug where
    A: Debug
{ type Parameters: Default; fn lift1_with<AS>(base: AS, args: Self::Parameters) -> BoxedStrategy<Self>
    where
        AS: Strategy<Value = A> + 'static
; fn lift1<AS>(base: AS) -> BoxedStrategy<Self>
    where
        AS: Strategy<Value = A> + 'static
, { ... } }

ArbitraryF1 lets you lift a Strategy to unary type constructors such as Box, Vec, and Option.

The trait corresponds to Haskell QuickCheck's Arbitrary1 type class.

Associated Types

type Parameters: Default

The type of parameters that lift1_with accepts for configuration of the lifted and generated Strategy. Parameters must implement Default.

Loading content...

Required methods

fn lift1_with<AS>(base: AS, args: Self::Parameters) -> BoxedStrategy<Self> where
    AS: Strategy<Value = A> + 'static, 

Lifts a given Strategy to a new Strategy for the (presumably) bigger type. This is useful for lifting a Strategy for SomeType to a container such as Vec of SomeType. The composite strategy is passed the arguments given in args.

If you wish to use the default() arguments, use lift1 instead.

Loading content...

Provided methods

fn lift1<AS>(base: AS) -> BoxedStrategy<Self> where
    AS: Strategy<Value = A> + 'static, 

Lifts a given Strategy to a new Strategy for the (presumably) bigger type. This is useful for lifting a Strategy for SomeType to a container such as Vec<SomeType>.

Calling this for the type X is the equivalent of using X::lift1_with(base, Default::default()).

This method is defined in the trait for optimization for the default if you want to do that. It is a logic error to not preserve the semantics when overriding.

Loading content...

Implementations on Foreign Types

impl<A> ArbitraryF1<A> for Discriminant<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A, T> ArbitraryF1<A> for Peekable<A> where
    A: 'static + Iterator<Item = T> + Debug,
    T: Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Rc<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Enumerate<A> where
    A: 'static + Iterator + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Debug
[src]

type Parameters = Probability

impl<A, K> ArbitraryF1<A> for BTreeMap<K, A> where
    A: Debug,
    K: 'static + Arbitrary + Ord
[src]

type Parameters = (SizeRange, <K as Arbitrary>::Parameters)

impl<A> ArbitraryF1<A> for BinaryHeap<A> where
    A: Ord + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Lines<A> where
    A: 'static + Debug + BufRead
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for AssertUnwindSafe<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for UnsafeCell<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for BTreeSet<A> where
    A: Ord + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Cycle<A> where
    A: 'static + Clone + Iterator + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Debug
[src]

type Parameters = SizeRange

impl<A, B> ArbitraryF1<A> for Cow<'static, B> where
    A: 'static + Borrow<B> + Debug,
    B: Debug + ToOwned<Owned = A>, 
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for BufWriter<A> where
    A: Debug + Write
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for HashSet<A, RandomState> where
    A: Eq + Hash + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Vec<A> where
    A: Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for BufReader<A> where
    A: Debug + Read
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Ord + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Take<A> where
    A: Iterator + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Wrapping<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Box<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for RwLock<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Ord + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Fuse<A> where
    A: 'static + Iterator + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Rev<A> where
    A: 'static + DoubleEndedIterator + Debug
[src]

type Parameters = ()

impl<A, B, T> ArbitraryF1<A> for Chain<B, A> where
    A: Iterator<Item = T> + Debug + 'static,
    B: 'static + Arbitrary + Iterator<Item = T>, 
[src]

type Parameters = <B as Arbitrary>::Parameters

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Eq + Hash + Debug
[src]

type Parameters = SizeRange

impl<'a, T, A> ArbitraryF1<A> for Cloned<A> where
    A: 'static + Iterator<Item = &'a T> + Debug,
    T: 'static + Clone
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for RefCell<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for VecDeque<A> where
    A: Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Arc<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for LinkedList<A> where
    A: Debug
[src]

type Parameters = SizeRange

impl<A> ArbitraryF1<A> for Result<A, !> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Once<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Repeat<A> where
    A: 'static + Clone + Debug
[src]

type Parameters = ()

impl<A, E> ArbitraryF1<A> for Result<A, E> where
    A: Debug,
    E: Arbitrary,
    <E as Arbitrary>::Strategy: 'static, 
[src]

type Parameters = (Probability, <E as Arbitrary>::Parameters)

impl<A> ArbitraryF1<A> for Option<A> where
    A: Debug
[src]

type Parameters = Probability

impl<A> ArbitraryF1<A> for IntoIter<A> where
    A: 'static + Debug
[src]

type Parameters = Probability

impl<A> ArbitraryF1<A> for Reverse<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for LineWriter<A> where
    A: Debug + Write
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Cursor<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Split<A> where
    A: 'static + Debug + BufRead
[src]

type Parameters = ()

impl<A, B> ArbitraryF1<A> for Zip<B, A> where
    A: 'static + Iterator + Debug,
    B: 'static + Arbitrary + Iterator
[src]

type Parameters = <B as Arbitrary>::Parameters

impl<A> ArbitraryF1<A> for Mutex<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A, K> ArbitraryF1<A> for HashMap<K, A, RandomState> where
    A: Debug,
    K: 'static + Arbitrary + Eq + Hash
[src]

type Parameters = (SizeRange, <K as Arbitrary>::Parameters)

impl<A> ArbitraryF1<A> for Take<A> where
    A: 'static + Debug + Read
[src]

type Parameters = ()

impl<A, K> ArbitraryF1<A> for IntoIter<K, A> where
    A: 'static + Debug,
    K: 'static + Arbitrary + Eq + Hash
[src]

type Parameters = (SizeRange, <K as Arbitrary>::Parameters)

impl<A> ArbitraryF1<A> for Cell<A> where
    A: 'static + Copy + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Skip<A> where
    A: Iterator + Debug
[src]

type Parameters = ()

Loading content...

Implementors

impl<A> ArbitraryF1<A> for RangeTo<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for RangeToInclusive<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Bound<A> where
    A: 'static + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for Range<A> where
    A: PartialOrd<A> + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for RangeInclusive<A> where
    A: PartialOrd<A> + Debug
[src]

type Parameters = ()

impl<A> ArbitraryF1<A> for RangeFrom<A> where
    A: 'static + Debug
[src]

type Parameters = ()

Loading content...