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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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