fuzz_util::zerocopy

Trait ArbitraryFromBytes

Source
pub trait ArbitraryFromBytes<'a>: FromBytes + Sized {
    // Required method
    fn arbitrary_from_bytes(u: &mut Unstructured<'a>) -> Result<Self>;
}
Expand description

Extension trait that allows construction of arbitrary values via [zerocopy::FromBytes].

ArbitraryFromBytes has a blanket implementation for all types that implement zerocopy::FromBytes.

Required Methods§

Source

fn arbitrary_from_bytes(u: &mut Unstructured<'a>) -> Result<Self>

Constructs an arbitrary instance of Self from the provided unstructured data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, A> ArbitraryFromBytes<'a> for A
where A: FromBytes + 'a,