Struct proptest_arbitrary_interop::ArbStrategy
source · [−]pub struct ArbStrategy<A: ArbInterop> { /* private fields */ }
Implementations
sourceimpl<A: ArbInterop> ArbStrategy<A>
impl<A: ArbInterop> ArbStrategy<A>
Trait Implementations
sourceimpl<A: Clone + ArbInterop> Clone for ArbStrategy<A>
impl<A: Clone + ArbInterop> Clone for ArbStrategy<A>
sourcefn clone(&self) -> ArbStrategy<A>
fn clone(&self) -> ArbStrategy<A>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<A: Debug + ArbInterop> Debug for ArbStrategy<A>
impl<A: Debug + ArbInterop> Debug for ArbStrategy<A>
sourceimpl<A: Hash + ArbInterop> Hash for ArbStrategy<A>
impl<A: Hash + ArbInterop> Hash for ArbStrategy<A>
sourceimpl<A: Ord + ArbInterop> Ord for ArbStrategy<A>
impl<A: Ord + ArbInterop> Ord for ArbStrategy<A>
sourcefn cmp(&self, other: &ArbStrategy<A>) -> Ordering
fn cmp(&self, other: &ArbStrategy<A>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<A: PartialEq + ArbInterop> PartialEq<ArbStrategy<A>> for ArbStrategy<A>
impl<A: PartialEq + ArbInterop> PartialEq<ArbStrategy<A>> for ArbStrategy<A>
sourcefn eq(&self, other: &ArbStrategy<A>) -> bool
fn eq(&self, other: &ArbStrategy<A>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArbStrategy<A>) -> bool
fn ne(&self, other: &ArbStrategy<A>) -> bool
This method tests for !=
.
sourceimpl<A: PartialOrd + ArbInterop> PartialOrd<ArbStrategy<A>> for ArbStrategy<A>
impl<A: PartialOrd + ArbInterop> PartialOrd<ArbStrategy<A>> for ArbStrategy<A>
sourcefn partial_cmp(&self, other: &ArbStrategy<A>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArbStrategy<A>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: ArbInterop> Strategy for ArbStrategy<A>
impl<A: ArbInterop> Strategy for ArbStrategy<A>
type Tree = ArbValueTree<A>
type Tree = ArbValueTree<A>
The value tree generated by this Strategy
.
sourcefn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
Generate a new value tree from the given runner. Read more
sourcefn prop_map<O, F>(self, fun: F) -> Map<Self, F> where
O: Debug,
F: Fn(Self::Value) -> O,
fn prop_map<O, F>(self, fun: F) -> Map<Self, F> where
O: Debug,
F: Fn(Self::Value) -> O,
Returns a strategy which produces values transformed by the function
fun
. Read more
sourcefn prop_map_into<O>(self) -> MapInto<Self, O> where
O: Debug,
Self::Value: Into<O>,
fn prop_map_into<O>(self) -> MapInto<Self, O> where
O: Debug,
Self::Value: Into<O>,
Returns a strategy which produces values of type O
by transforming
Self
with Into<O>
. Read more
sourcefn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F> where
O: Debug,
F: Fn(Self::Value, TestRng) -> O,
fn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F> where
O: Debug,
F: Fn(Self::Value, TestRng) -> O,
Returns a strategy which produces values transformed by the function
fun
, which is additionally given a random number generator. Read more
sourcefn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>> where
S: Strategy,
F: Fn(Self::Value) -> S,
fn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>> where
S: Strategy,
F: Fn(Self::Value) -> S,
Maps values produced by this strategy into new strategies and picks values from those strategies. Read more
sourcefn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>> where
S: Strategy,
F: Fn(Self::Value) -> S,
fn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>> where
S: Strategy,
F: Fn(Self::Value) -> S,
Maps values produced by this strategy into new strategies and picks values from those strategies while considering the new strategies to be independent. Read more
sourcefn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F> where
S: Strategy,
F: Fn(Self::Value) -> S,
fn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F> where
S: Strategy,
F: Fn(Self::Value) -> S,
Similar to prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read more
sourcefn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F> where
R: Into<Reason>,
F: Fn(&Self::Value) -> bool,
fn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F> where
R: Into<Reason>,
F: Fn(&Self::Value) -> bool,
Returns a strategy which only produces values accepted by fun
. Read more
sourcefn prop_filter_map<F, O>(
self,
whence: impl Into<Reason>,
fun: F
) -> FilterMap<Self, F> where
F: Fn(Self::Value) -> Option<O>,
O: Debug,
fn prop_filter_map<F, O>(
self,
whence: impl Into<Reason>,
fun: F
) -> FilterMap<Self, F> where
F: Fn(Self::Value) -> Option<O>,
O: Debug,
Returns a strategy which only produces transformed values where fun
returns Some(value)
and rejects those where fun
returns None
. Read more
sourcefn prop_union(self, other: Self) -> Union<Self>
fn prop_union(self, other: Self) -> Union<Self>
Returns a strategy which picks uniformly from self
and other
. Read more
sourcefn prop_recursive<R, F>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F
) -> Recursive<Self::Value, F> where
R: 'static + Strategy<Value = Self::Value>,
F: Fn(BoxedStrategy<Self::Value>) -> R,
Self: 'static,
fn prop_recursive<R, F>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F
) -> Recursive<Self::Value, F> where
R: 'static + Strategy<Value = Self::Value>,
F: Fn(BoxedStrategy<Self::Value>) -> R,
Self: 'static,
Generate a recursive structure with self
items as leaves. Read more
sourcefn prop_shuffle(self) -> Shuffle<Self> where
Self::Value: Shuffleable,
fn prop_shuffle(self) -> Shuffle<Self> where
Self::Value: Shuffleable,
Shuffle the contents of the values produced by this strategy. Read more
sourcefn boxed(self) -> BoxedStrategy<Self::Value> where
Self: 'static,
fn boxed(self) -> BoxedStrategy<Self::Value> where
Self: 'static,
Erases the type of this Strategy
so it can be passed around as a
simple trait object. Read more
impl<A: Copy + ArbInterop> Copy for ArbStrategy<A>
impl<A: Eq + ArbInterop> Eq for ArbStrategy<A>
impl<A: ArbInterop> StructuralEq for ArbStrategy<A>
impl<A: ArbInterop> StructuralPartialEq for ArbStrategy<A>
Auto Trait Implementations
impl<A> RefUnwindSafe for ArbStrategy<A> where
A: RefUnwindSafe,
impl<A> Send for ArbStrategy<A> where
A: Send,
impl<A> Sync for ArbStrategy<A> where
A: Sync,
impl<A> Unpin for ArbStrategy<A> where
A: Unpin,
impl<A> UnwindSafe for ArbStrategy<A> where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more