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§
Sourcefn arbitrary_from_bytes(u: &mut Unstructured<'a>) -> Result<Self>
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.