pub trait FromBytesOwned: Sized {
// Required method
fn from_bytes_owned(data: &[u8]) -> Result<Self, Error>;
}Expand description
FromBytesOwned is similar to FromBytes but it doesn’t borrow from the input slice.
FromBytes is automatically implemented for all types that implement FromBytesOwned.
FromBytesOwned can be derived through #[derive(FromBytes)].
Required Methods§
Sourcefn from_bytes_owned(data: &[u8]) -> Result<Self, Error>
fn from_bytes_owned(data: &[u8]) -> Result<Self, Error>
Decode a value from a slice of bytes, the resulting value should not borrow the input 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.