Trait extism_pdk::FromBytesOwned
source · 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.
Object Safety§
This trait is not object safe.