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> + 'static> { ... } }
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 since every test is run inside its own task. (This permits failures to include task failures.)
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 + Eq + Hash, V: Arbitrary> Arbitrary for HashMap<K, V>
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