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

Important traits for Box<R>

Implementations on Foreign Types

impl Arbitrary for ()
[src]

Important traits for Box<R>

impl Arbitrary for bool
[src]

Important traits for Box<R>

impl<A: Arbitrary> Arbitrary for Option<A>
[src]

Important traits for Box<R>

impl<A: Arbitrary, B: Arbitrary> Arbitrary for Result<A, B>
[src]

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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

Important traits for Box<R>

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)
[src]

Important traits for Box<R>

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)
[src]

Important traits for Box<R>

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)
[src]

Important traits for Box<R>

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)
[src]

Important traits for Box<R>

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)
[src]

Important traits for Box<R>

impl<A: Arbitrary> Arbitrary for Vec<A>
[src]

Important traits for Vec<u8>

Important traits for Box<R>

impl<K: Arbitrary + Ord, V: Arbitrary> Arbitrary for BTreeMap<K, V>
[src]

Important traits for Box<R>

impl<K: Arbitrary + Eq + Hash, V: Arbitrary> Arbitrary for HashMap<K, V>
[src]

Important traits for Box<R>

impl<T: Arbitrary + Ord> Arbitrary for BTreeSet<T>
[src]

Important traits for Box<R>

impl<T: Arbitrary + Ord> Arbitrary for BinaryHeap<T>
[src]

Important traits for Box<R>

impl<T: Arbitrary + Eq + Hash> Arbitrary for HashSet<T>
[src]

Important traits for Box<R>

impl<T: Arbitrary> Arbitrary for LinkedList<T>
[src]

Important traits for Box<R>

impl<T: Arbitrary> Arbitrary for VecDeque<T>
[src]

Important traits for Box<R>

impl Arbitrary for String
[src]

Important traits for Box<R>

impl Arbitrary for char
[src]

Important traits for Box<R>

impl Arbitrary for usize
[src]

Important traits for Box<R>

impl Arbitrary for u8
[src]

Important traits for Box<R>

impl Arbitrary for u16
[src]

Important traits for Box<R>

impl Arbitrary for u32
[src]

Important traits for Box<R>

impl Arbitrary for u64
[src]

Important traits for Box<R>

impl Arbitrary for isize
[src]

Important traits for Box<R>

impl Arbitrary for i8
[src]

Important traits for Box<R>

impl Arbitrary for i16
[src]

Important traits for Box<R>

impl Arbitrary for i32
[src]

Important traits for Box<R>

impl Arbitrary for i64
[src]

Important traits for Box<R>

impl Arbitrary for f32
[src]

Important traits for Box<R>

impl Arbitrary for f64
[src]

Important traits for Box<R>

impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for Range<T>
[src]

Important traits for Range<A>

Important traits for Box<R>

impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for RangeFrom<T>
[src]

Important traits for RangeFrom<A>

Important traits for Box<R>

impl<T: Arbitrary + Clone + PartialOrd> Arbitrary for RangeTo<T>
[src]

Important traits for Box<R>

impl Arbitrary for RangeFull
[src]

Important traits for Box<R>

impl Arbitrary for Duration
[src]

Important traits for Box<R>

Implementors