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]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for bool
[src]

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

Important traits for Vec<u8>
[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

impl<K: Arbitrary + Eq + Hash, V: Arbitrary, S: BuildHasher + Default + Clone + Send + 'static> Arbitrary for HashMap<K, V, S>
[src]

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

impl<T: Arbitrary + Eq + Hash, S: BuildHasher + Default + Clone + Send + 'static> Arbitrary for HashSet<T, S>
[src]

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

impl Arbitrary for IpAddr
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for Ipv4Addr
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for Ipv6Addr
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for SocketAddr
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for SocketAddrV4
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for SocketAddrV6
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for PathBuf
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for OsString
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for String
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for char
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for usize
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for u8
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for u16
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for u32
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for u64
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for isize
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for i8
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for i16
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for i32
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for i64
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for f32
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for f64
[src]

[src]

Important traits for Box<R>
[src]

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

Important traits for Range<A>
[src]

Important traits for Box<R>
[src]

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

Important traits for RangeFrom<A>
[src]

Important traits for Box<R>
[src]

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

[src]

Important traits for Box<R>
[src]

impl Arbitrary for RangeFull
[src]

[src]

Important traits for Box<R>
[src]

impl Arbitrary for Duration
[src]

[src]

Important traits for Box<R>
[src]

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

Important traits for Box<R>
[src]

Important traits for Box<R>
[src]

impl<A: Arbitrary + Sync> Arbitrary for Arc<A>
[src]

[src]

Important traits for Box<R>
[src]

Implementors