Trait reth_primitives::arbitrary::Arbitrary
pub trait Arbitrary<'a>: Sized {
// Required method
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self, Error>;
// Provided methods
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error> { ... }
fn size_hint(depth: usize) -> (usize, Option<usize>) { ... }
}
Expand description
Generate arbitrary structured values from raw, unstructured data.
The Arbitrary
trait allows you to generate valid structured values, like
HashMap
s, or ASTs, or MyTomlConfig
, or any other data structure from
raw, unstructured bytes provided by a fuzzer.
§Deriving Arbitrary
Automatically deriving the Arbitrary
trait is the recommended way to
implement Arbitrary
for your types.
Using the custom derive requires that you enable the "derive"
cargo
feature in your Cargo.toml
:
[dependencies]
arbitrary = { version = "1", features = ["derive"] }
Then, you add the #[derive(Arbitrary)]
annotation to your struct
or
enum
type definition:
use arbitrary::Arbitrary;
use std::collections::HashSet;
#[derive(Arbitrary)]
pub struct AddressBook {
friends: HashSet<Friend>,
}
#[derive(Arbitrary, Hash, Eq, PartialEq)]
pub enum Friend {
Buddy { name: String },
Pal { age: usize },
}
Every member of the struct
or enum
must also implement Arbitrary
.
§Implementing Arbitrary
By Hand
Implementing Arbitrary
mostly involves nested calls to other Arbitrary
arbitrary implementations for each of your struct
or enum
’s members. But
sometimes you need some amount of raw data, or you need to generate a
variably-sized collection type, or something of that sort. The
Unstructured
type helps you with these tasks.
use arbitrary::{Arbitrary, Result, Unstructured};
impl<'a, T> Arbitrary<'a> for MyCollection<T>
where
T: Arbitrary<'a>,
{
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
// Get an iterator of arbitrary `T`s.
let iter = u.arbitrary_iter::<T>()?;
// And then create a collection!
let mut my_collection = MyCollection::new();
for elem_result in iter {
let elem = elem_result?;
my_collection.insert(elem);
}
Ok(my_collection)
}
}
Required Methods§
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of Self
from the given unstructured data.
Calling Arbitrary::arbitrary
requires that you have some raw data,
perhaps given to you by a fuzzer like AFL or libFuzzer. You wrap this
raw data in an Unstructured
, and then you can call <MyType as Arbitrary>::arbitrary
to construct an arbitrary instance of MyType
from that unstructured data.
Implementations may return an error if there is not enough data to
construct a full instance of Self
, or they may fill out the rest of
Self
with dummy values. Using dummy values when the underlying data is
exhausted can help avoid accidentally “defeating” some of the fuzzer’s
mutations to the underlying byte stream that might otherwise lead to
interesting runtime behavior or new code coverage if only we had just a
few more bytes. However, it also requires that implementations for
recursive types (e.g. struct Foo(Option<Box<Foo>>)
) avoid infinite
recursion when the underlying data is exhausted.
use arbitrary::{Arbitrary, Unstructured};
#[derive(Arbitrary)]
pub struct MyType {
// ...
}
// Get the raw data from the fuzzer or wherever else.
let raw_data: &[u8] = get_raw_data_from_fuzzer();
// Wrap that raw data in an `Unstructured`.
let mut unstructured = Unstructured::new(raw_data);
// Generate an arbitrary instance of `MyType` and do stuff with it.
if let Ok(value) = MyType::arbitrary(&mut unstructured) {
do_stuff(value);
}
See also the documentation for Unstructured
.
Provided Methods§
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of Self
from the entirety of the given
unstructured data.
This is similar to Arbitrary::arbitrary, however it assumes that it is
the last consumer of the given data, and is thus able to consume it all
if it needs. See also the documentation for
Unstructured
.
fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an Unstructured
this type
needs to construct itself.
This is useful for determining how many elements we should insert when creating an arbitrary collection.
The return value is similar to
Iterator::size_hint
: it returns a tuple where
the first element is a lower bound on the number of bytes required, and
the second element is an optional upper bound.
The default implementation return (0, None)
which is correct for any
type, but not ultimately that useful. Using #[derive(Arbitrary)]
will
create a better implementation. If you are writing an Arbitrary
implementation by hand, and your type can be part of a dynamically sized
collection (such as Vec
), you are strongly encouraged to override this
default with a better implementation. The
size_hint
module will help with this task.
§Invariant
It must be possible to construct every possible output using only inputs
of lengths bounded by these parameters. This applies to both
Arbitrary::arbitrary
and Arbitrary::arbitrary_take_rest
.
This is trivially true for (0, None)
. To restrict this further, it
must be proven that all inputs that are now excluded produced redundant
outputs which are still possible to produce using the reduced input
space.
§The depth
Parameter
If you 100% know that the type you are implementing Arbitrary
for is
not a recursive type, or your implementation is not transitively calling
any other size_hint
methods, you can ignore the depth
parameter.
Note that if you are implementing Arbitrary
for a generic type, you
cannot guarantee the lack of type recursion!
Otherwise, you need to use
arbitrary::size_hint::recursion_guard(depth)
to prevent potential infinite recursion when calculating size hints for
potentially recursive types:
use arbitrary::{Arbitrary, Unstructured, size_hint};
// This can potentially be a recursive type if `L` or `R` contain
// something like `Box<Option<MyEither<L, R>>>`!
enum MyEither<L, R> {
Left(L),
Right(R),
}
impl<'a, L, R> Arbitrary<'a> for MyEither<L, R>
where
L: Arbitrary<'a>,
R: Arbitrary<'a>,
{
fn arbitrary(u: &mut Unstructured) -> arbitrary::Result<Self> {
// ...
}
fn size_hint(depth: usize) -> (usize, Option<usize>) {
// Protect against potential infinite recursion with
// `recursion_guard`.
size_hint::recursion_guard(depth, |depth| {
// If we aren't too deep, then `recursion_guard` calls
// this closure, which implements the natural size hint.
// Don't forget to use the new `depth` in all nested
// `size_hint` calls! We recommend shadowing the
// parameter, like what is done here, so that you can't
// accidentally use the wrong depth.
size_hint::or(
<L as Arbitrary>::size_hint(depth),
<R as Arbitrary>::size_hint(depth),
)
})
}
}
Object Safety§
Implementations on Foreign Types§
§impl Arbitrary<'_> for OtherFields
impl Arbitrary<'_> for OtherFields
fn arbitrary(u: &mut Unstructured<'_>) -> Result<OtherFields, Error>
§impl<'a> Arbitrary<'a> for AtomicBool
impl<'a> Arbitrary<'a> for AtomicBool
§impl<'a> Arbitrary<'a> for AtomicIsize
impl<'a> Arbitrary<'a> for AtomicIsize
§impl<'a> Arbitrary<'a> for AtomicUsize
impl<'a> Arbitrary<'a> for AtomicUsize
§impl<'a> Arbitrary<'a> for Chain
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for Chain
arbitrary
only.fn arbitrary(u: &mut Unstructured<'a>) -> Result<Chain, Error>
§impl<'a> Arbitrary<'a> for IntegerList
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for IntegerList
arbitrary
only.fn arbitrary(u: &mut Unstructured<'a>) -> Result<IntegerList, Error>
§impl<'a> Arbitrary<'a> for OpTxType
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for OpTxType
arbitrary
only.fn arbitrary(u: &mut Unstructured<'_>) -> Result<OpTxType, Error>
§impl<'a> Arbitrary<'a> for TxType
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for TxType
arbitrary
only.fn arbitrary(u: &mut Unstructured<'_>) -> Result<TxType, Error>
§impl<'a, A> Arbitrary<'a> for BinaryHeap<A>
impl<'a, A> Arbitrary<'a> for BinaryHeap<A>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<BinaryHeap<A>, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<BinaryHeap<A>, Error>
fn size_hint(_depth: usize) -> (usize, Option<usize>)
§impl<'a, A> Arbitrary<'a> for LinkedList<A>where
A: Arbitrary<'a>,
impl<'a, A> Arbitrary<'a> for LinkedList<A>where
A: Arbitrary<'a>,
fn arbitrary(u: &mut Unstructured<'a>) -> Result<LinkedList<A>, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<LinkedList<A>, Error>
fn size_hint(_depth: usize) -> (usize, Option<usize>)
§impl<'a, A> Arbitrary<'a> for UnsafeCell<A>where
A: Arbitrary<'a>,
impl<'a, A> Arbitrary<'a> for UnsafeCell<A>where
A: Arbitrary<'a>,
§impl<'a, A> Arbitrary<'a> for PhantomData<A>where
A: Arbitrary<'a>,
impl<'a, A> Arbitrary<'a> for PhantomData<A>where
A: Arbitrary<'a>,
§impl<'a, A> Arbitrary<'a> for RangeInclusive<A>
impl<'a, A> Arbitrary<'a> for RangeInclusive<A>
§impl<'a, A> Arbitrary<'a> for RangeToInclusive<A>
impl<'a, A> Arbitrary<'a> for RangeToInclusive<A>
§impl<'a, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A> Arbitrary<'a> for (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A)where
B: Arbitrary<'a>,
C: Arbitrary<'a>,
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
A: Arbitrary<'a>,
impl<'a, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A> Arbitrary<'a> for (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A)where
B: Arbitrary<'a>,
C: Arbitrary<'a>,
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
A: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, A), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B> Arbitrary<'a> for (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B)where
C: Arbitrary<'a>,
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
B: Arbitrary<'a>,
impl<'a, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B> Arbitrary<'a> for (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B)where
C: Arbitrary<'a>,
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
B: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, B), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C> Arbitrary<'a> for (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C)where
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
C: Arbitrary<'a>,
impl<'a, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C> Arbitrary<'a> for (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C)where
D: Arbitrary<'a>,
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
C: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, C), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D> Arbitrary<'a> for (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D)where
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
D: Arbitrary<'a>,
impl<'a, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D> Arbitrary<'a> for (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D)where
E: Arbitrary<'a>,
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
D: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E> Arbitrary<'a> for (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E)where
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
E: Arbitrary<'a>,
impl<'a, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E> Arbitrary<'a> for (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E)where
F: Arbitrary<'a>,
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
E: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, E), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F> Arbitrary<'a> for (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F)where
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
F: Arbitrary<'a>,
impl<'a, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F> Arbitrary<'a> for (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F)where
G: Arbitrary<'a>,
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
F: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, F), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G> Arbitrary<'a> for (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G)where
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
G: Arbitrary<'a>,
impl<'a, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G> Arbitrary<'a> for (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G)where
H: Arbitrary<'a>,
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
G: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, G), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H> Arbitrary<'a> for (I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H)where
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
H: Arbitrary<'a>,
impl<'a, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H> Arbitrary<'a> for (I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H)where
I: Arbitrary<'a>,
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
H: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, H), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I> Arbitrary<'a> for (J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I)where
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
I: Arbitrary<'a>,
impl<'a, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I> Arbitrary<'a> for (J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I)where
J: Arbitrary<'a>,
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
I: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, I), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J> Arbitrary<'a> for (K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J)where
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
J: Arbitrary<'a>,
impl<'a, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J> Arbitrary<'a> for (K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J)where
K: Arbitrary<'a>,
L: Arbitrary<'a>,
M: Arbitrary<'a>,
N: Arbitrary<'a>,
O: Arbitrary<'a>,
P: Arbitrary<'a>,
Q: Arbitrary<'a>,
R: Arbitrary<'a>,
S: Arbitrary<'a>,
T: Arbitrary<'a>,
U: Arbitrary<'a>,
V: Arbitrary<'a>,
W: Arbitrary<'a>,
X: Arbitrary<'a>,
Y: Arbitrary<'a>,
Z: Arbitrary<'a>,
J: Arbitrary<'a>,
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, J), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K> Arbitrary<'a> for (L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K)
impl<'a, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K> Arbitrary<'a> for (L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, K), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L> Arbitrary<'a> for (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L)
impl<'a, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L> Arbitrary<'a> for (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, L), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M> Arbitrary<'a> for (N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M)
impl<'a, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M> Arbitrary<'a> for (N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(N, O, P, Q, R, S, T, U, V, W, X, Y, Z, M), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, O, P, Q, R, S, T, U, V, W, X, Y, Z, N> Arbitrary<'a> for (O, P, Q, R, S, T, U, V, W, X, Y, Z, N)
impl<'a, O, P, Q, R, S, T, U, V, W, X, Y, Z, N> Arbitrary<'a> for (O, P, Q, R, S, T, U, V, W, X, Y, Z, N)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(O, P, Q, R, S, T, U, V, W, X, Y, Z, N), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(O, P, Q, R, S, T, U, V, W, X, Y, Z, N), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, P, Q, R, S, T, U, V, W, X, Y, Z, O> Arbitrary<'a> for (P, Q, R, S, T, U, V, W, X, Y, Z, O)
impl<'a, P, Q, R, S, T, U, V, W, X, Y, Z, O> Arbitrary<'a> for (P, Q, R, S, T, U, V, W, X, Y, Z, O)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(P, Q, R, S, T, U, V, W, X, Y, Z, O), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(P, Q, R, S, T, U, V, W, X, Y, Z, O), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, Q, R, S, T, U, V, W, X, Y, Z, P> Arbitrary<'a> for (Q, R, S, T, U, V, W, X, Y, Z, P)
impl<'a, Q, R, S, T, U, V, W, X, Y, Z, P> Arbitrary<'a> for (Q, R, S, T, U, V, W, X, Y, Z, P)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(Q, R, S, T, U, V, W, X, Y, Z, P), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(Q, R, S, T, U, V, W, X, Y, Z, P), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, R, S, T, U, V, W, X, Y, Z, Q> Arbitrary<'a> for (R, S, T, U, V, W, X, Y, Z, Q)
impl<'a, R, S, T, U, V, W, X, Y, Z, Q> Arbitrary<'a> for (R, S, T, U, V, W, X, Y, Z, Q)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(R, S, T, U, V, W, X, Y, Z, Q), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(R, S, T, U, V, W, X, Y, Z, Q), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, S, T, U, V, W, X, Y, Z, R> Arbitrary<'a> for (S, T, U, V, W, X, Y, Z, R)
impl<'a, S, T, U, V, W, X, Y, Z, R> Arbitrary<'a> for (S, T, U, V, W, X, Y, Z, R)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(S, T, U, V, W, X, Y, Z, R), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(S, T, U, V, W, X, Y, Z, R), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, T> Arbitrary<'a> for ReceiptEnvelope<T>where
T: Arbitrary<'a>,
Available on crate feature arbitrary
only.
impl<'a, T> Arbitrary<'a> for ReceiptEnvelope<T>where
T: Arbitrary<'a>,
arbitrary
only.fn arbitrary(u: &mut Unstructured<'a>) -> Result<ReceiptEnvelope<T>, Error>
§impl<'a, T> Arbitrary<'a> for ReceiptWithBloom<T>where
T: Arbitrary<'a>,
Available on crate feature arbitrary
only.
impl<'a, T> Arbitrary<'a> for ReceiptWithBloom<T>where
T: Arbitrary<'a>,
arbitrary
only.fn arbitrary(u: &mut Unstructured<'a>) -> Result<ReceiptWithBloom<T>, Error>
§impl<'a, T, U, V, W, X, Y, Z, S> Arbitrary<'a> for (T, U, V, W, X, Y, Z, S)
impl<'a, T, U, V, W, X, Y, Z, S> Arbitrary<'a> for (T, U, V, W, X, Y, Z, S)
fn arbitrary( u: &mut Unstructured<'a>, ) -> Result<(T, U, V, W, X, Y, Z, S), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(T, U, V, W, X, Y, Z, S), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, U, V, W, X, Y, Z, T> Arbitrary<'a> for (U, V, W, X, Y, Z, T)
impl<'a, U, V, W, X, Y, Z, T> Arbitrary<'a> for (U, V, W, X, Y, Z, T)
fn arbitrary(u: &mut Unstructured<'a>) -> Result<(U, V, W, X, Y, Z, T), Error>
fn arbitrary_take_rest( u: Unstructured<'a>, ) -> Result<(U, V, W, X, Y, Z, T), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, V, W, X, Y, Z, U> Arbitrary<'a> for (V, W, X, Y, Z, U)
impl<'a, V, W, X, Y, Z, U> Arbitrary<'a> for (V, W, X, Y, Z, U)
fn arbitrary(u: &mut Unstructured<'a>) -> Result<(V, W, X, Y, Z, U), Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<(V, W, X, Y, Z, U), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, W, X, Y, Z, V> Arbitrary<'a> for (W, X, Y, Z, V)
impl<'a, W, X, Y, Z, V> Arbitrary<'a> for (W, X, Y, Z, V)
fn arbitrary(u: &mut Unstructured<'a>) -> Result<(W, X, Y, Z, V), Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<(W, X, Y, Z, V), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'a, X, Y, Z, W> Arbitrary<'a> for (X, Y, Z, W)
impl<'a, X, Y, Z, W> Arbitrary<'a> for (X, Y, Z, W)
fn arbitrary(u: &mut Unstructured<'a>) -> Result<(X, Y, Z, W), Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<(X, Y, Z, W), Error>
fn size_hint(depth: usize) -> (usize, Option<usize>)
§impl<'arbitrary, const BITS: usize, const LIMBS: usize> Arbitrary<'arbitrary> for Signed<BITS, LIMBS>
impl<'arbitrary, const BITS: usize, const LIMBS: usize> Arbitrary<'arbitrary> for Signed<BITS, LIMBS>
Implementors§
impl<'a> Arbitrary<'a> for PooledTransactionsElement
arbitrary
only.impl<'a> Arbitrary<'a> for reth_primitives::transaction::Transaction
arbitrary
only.impl<'a> Arbitrary<'a> for SignedAuthorization
arbitrary
and k256
only.impl<'a> Arbitrary<'a> for Address
impl<'a> Arbitrary<'a> for BlobTransactionSidecar
arbitrary
only.impl<'a> Arbitrary<'a> for Block
arbitrary
only.impl<'a> Arbitrary<'a> for BlockBody
arbitrary
only.impl<'a> Arbitrary<'a> for Bloom
impl<'a> Arbitrary<'a> for Bytes
arbitrary
only.impl<'a> Arbitrary<'a> for reth_primitives::Header
test-utils
or arbitrary
only.impl<'a> Arbitrary<'a> for reth_primitives::Receipt
arbitrary
only.impl<'a> Arbitrary<'a> for SealedHeader
arbitrary
only.impl<'a> Arbitrary<'a> for TransactionSigned
arbitrary
only.