rustmax::proptest::arbitrary::functor

Trait ArbitraryF1

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

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.

Required Associated Types§

Source

type Parameters: Default

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

Required Methods§

Source

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.

Provided Methods§

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A> ArbitraryF1<A> for Bound<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Option<A>
where A: Debug,

Source§

impl<A> ArbitraryF1<A> for Result<A, Infallible>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Box<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Cell<A>
where A: Debug + 'static + Copy,

Source§

impl<A> ArbitraryF1<A> for RefCell<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for UnsafeCell<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Reverse<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for BinaryHeap<A>
where A: Debug + Ord,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::collections::binary_heap::IntoIter<A>
where A: Debug + 'static + Ord,

Source§

impl<A> ArbitraryF1<A> for BTreeSet<A>
where A: Debug + Ord,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::collections::btree_set::IntoIter<A>
where A: Debug + 'static + Ord,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::collections::hash_set::IntoIter<A>
where A: Debug + 'static + Hash + Eq,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::collections::linked_list::IntoIter<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for LinkedList<A>
where A: Debug,

Source§

impl<A> ArbitraryF1<A> for HashSet<A>
where A: Debug + Hash + Eq,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::collections::vec_deque::IntoIter<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for VecDeque<A>
where A: Debug,

Source§

impl<A> ArbitraryF1<A> for BufReader<A>
where A: Debug + Read,

Source§

impl<A> ArbitraryF1<A> for BufWriter<A>
where A: Debug + Write,

Source§

impl<A> ArbitraryF1<A> for Cursor<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for LineWriter<A>
where A: Debug + Write,

Source§

impl<A> ArbitraryF1<A> for Lines<A>
where A: Debug + 'static + BufRead,

Source§

impl<A> ArbitraryF1<A> for Split<A>
where A: Debug + 'static + BufRead,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::io::Take<A>
where A: Debug + 'static + Read,

Source§

impl<A> ArbitraryF1<A> for Cycle<A>
where A: Debug + 'static + Iterator + Clone,

Source§

impl<A> ArbitraryF1<A> for Enumerate<A>
where A: Debug + 'static + Iterator,

Source§

impl<A> ArbitraryF1<A> for Fuse<A>
where A: Debug + 'static + Iterator,

Source§

impl<A> ArbitraryF1<A> for Once<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Repeat<A>
where A: Debug + 'static + Clone,

Source§

impl<A> ArbitraryF1<A> for Rev<A>
where A: Debug + 'static + DoubleEndedIterator,

Source§

impl<A> ArbitraryF1<A> for Skip<A>
where A: Debug + Iterator,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::iter::Take<A>
where A: Debug + Iterator,

Source§

impl<A> ArbitraryF1<A> for Discriminant<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Wrapping<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Range<A>
where A: Debug + PartialOrd,

Source§

impl<A> ArbitraryF1<A> for RangeFrom<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for RangeInclusive<A>
where A: Debug + PartialOrd,

Source§

impl<A> ArbitraryF1<A> for RangeTo<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for RangeToInclusive<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::option::IntoIter<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for AssertUnwindSafe<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Rc<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::result::IntoIter<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Arc<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Mutex<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for RwLock<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for rustmax::std::vec::IntoIter<A>
where A: Debug + 'static,

Source§

impl<A> ArbitraryF1<A> for Vec<A>
where A: Debug,

Source§

impl<A, B> ArbitraryF1<A> for Cow<'static, B>
where A: Debug + Borrow<B> + 'static, B: ToOwned<Owned = A> + Debug + ?Sized,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<A, K> ArbitraryF1<A> for rustmax::std::collections::hash_map::IntoIter<K, A>
where A: Debug + 'static, K: Hash + Eq + Arbitrary + 'static,

Source§

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

Source§

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

Source§

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