Trait quickcheck::Arbitrary
[−]
[src]
pub trait Arbitrary: Clone + Send + 'static { fn arbitrary<G: Gen>(g: &mut G) -> Self; fn shrink(&self) -> Box<Iterator<Item=Self>> { ... } }
Arbitrary
describes types whose values can be randomly generated and
shrunk.
Aside from shrinking, Arbitrary
is different from the std::Rand
trait
in that it uses a Gen
to control the distribution of random values.
As of now, all types that implement Arbitrary
must also implement
Clone
. (I'm not sure if this is a permanent restriction.)
They must also be sendable and static since every test is run in its own
thread using thread::Builder::spawn
, which requires the Send + 'static
bounds.
Required Methods
Provided Methods
Implementors
impl Arbitrary for ()
impl Arbitrary for bool
impl<A: Arbitrary> Arbitrary for Option<A>
impl<A: Arbitrary, B: Arbitrary> Arbitrary for Result<A, B>
impl<A: Arbitrary> Arbitrary for (A,)
impl<A: Arbitrary, B: Arbitrary> Arbitrary for (A, B)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary> Arbitrary for (A, B, C)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary> Arbitrary for (A, B, C, D)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary> Arbitrary for (A, B, C, D, E)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary> Arbitrary for (A, B, C, D, E, F)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary> Arbitrary for (A, B, C, D, E, F, G)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary, H: Arbitrary> Arbitrary for (A, B, C, D, E, F, G, H)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary, H: Arbitrary, I: Arbitrary> Arbitrary for (A, B, C, D, E, F, G, H, I)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary, H: Arbitrary, I: Arbitrary, J: Arbitrary> Arbitrary for (A, B, C, D, E, F, G, H, I, J)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary, H: Arbitrary, I: Arbitrary, J: Arbitrary, K: Arbitrary> Arbitrary for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: Arbitrary, B: Arbitrary, C: Arbitrary, D: Arbitrary, E: Arbitrary, F: Arbitrary, G: Arbitrary, H: Arbitrary, I: Arbitrary, J: Arbitrary, K: Arbitrary, L: Arbitrary> Arbitrary for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A: Arbitrary> Arbitrary for Vec<A>
impl<K: Arbitrary + Ord, V: Arbitrary> Arbitrary for BTreeMap<K, V>
impl<K: Arbitrary + Eq + Hash, V: Arbitrary> Arbitrary for HashMap<K, V>
impl<T: Arbitrary + Ord> Arbitrary for BTreeSet<T>
impl<T: Arbitrary + Ord> Arbitrary for BinaryHeap<T>
impl<T: Arbitrary + Eq + Hash> Arbitrary for HashSet<T>
impl<T: Arbitrary> Arbitrary for LinkedList<T>
impl<T: Arbitrary> Arbitrary for VecDeque<T>
impl Arbitrary for String
impl Arbitrary for char
impl Arbitrary for usize
impl Arbitrary for u8
impl Arbitrary for u16
impl Arbitrary for u32
impl Arbitrary for u64
impl Arbitrary for isize
impl Arbitrary for i8
impl Arbitrary for i16
impl Arbitrary for i32
impl Arbitrary for i64
impl Arbitrary for f32
impl Arbitrary for f64
impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for Range<T>
impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for RangeFrom<T>
impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for RangeTo<T>
impl Arbitrary for RangeFull
impl Arbitrary for Duration