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 Value
impl FromBytesOwned for Value
Source§impl FromBytesOwned for bool
impl FromBytesOwned for bool
Source§impl FromBytesOwned for f32
impl FromBytesOwned for f32
Source§impl FromBytesOwned for f64
impl FromBytesOwned for f64
Source§impl FromBytesOwned for i32
impl FromBytesOwned for i32
Source§impl FromBytesOwned for i64
impl FromBytesOwned for i64
Source§impl FromBytesOwned for u32
impl FromBytesOwned for u32
Source§impl FromBytesOwned for u64
impl FromBytesOwned for u64
Source§impl FromBytesOwned for ()
impl FromBytesOwned for ()
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: Default + Message> FromBytesOwned for Prost<T>
Available on crate feature
prost only.