Lines Matching refs:Arbitrary
3 <h1><code>Arbitrary</code></h1>
13 The `Arbitrary` crate lets you construct arbitrary instance of a type.
29 represent RGB colors. You might want to implement `Arbitrary` for `Rgb` so that
34 ### Automatically Deriving `Arbitrary`
36 Automatically deriving the `Arbitrary` trait is the recommended way to implement
37 `Arbitrary` for your types.
39 Automatically deriving `Arbitrary` requires you to enable the `"derive"` cargo
49 And then you can simply add `#[derive(Arbitrary)]` annotations to your types:
54 use arbitrary::Arbitrary;
56 #[derive(Arbitrary)]
64 ### Implementing `Arbitrary` By Hand
66 Alternatively, you can write an `Arbitrary` implementation by hand:
71 use arbitrary::{Arbitrary, Result, Unstructured};
80 impl<'a> Arbitrary<'a> for Rgb {