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.
Implementations on Foreign Types§
Source§impl FromBytesOwned for Box<[u8]>
impl FromBytesOwned for Box<[u8]>
Source§impl FromBytesOwned for String
impl FromBytesOwned for String
Source§impl FromBytesOwned for Vec<u8>
impl FromBytesOwned for Vec<u8>
Implementors§
impl FromBytesOwned for Base64<String>
impl FromBytesOwned for Base64<Vec<u8>>
impl<T> FromBytesOwned for Json<T>where
T: DeserializeOwned,
impl<T> FromBytesOwned for Msgpack<T>where
T: DeserializeOwned,
impl<T> FromBytesOwned for Prost<T>
Available on crate feature
prost only.