pub trait FromByteSlice {
// Required methods
fn from_le_byte_slice(bytes: &[u8]) -> Self;
fn bytes_expected() -> usize;
}
Expand description
A trait to deserialize the implemeting type from a byte slice.
Required Methods§
Sourcefn from_le_byte_slice(bytes: &[u8]) -> Self
fn from_le_byte_slice(bytes: &[u8]) -> Self
Deserialize the implementing type from a byte slice.
Sourcefn bytes_expected() -> usize
fn bytes_expected() -> usize
Returns how many bytes are expected to deserialize a instance of the implementing type. Currently this method is only used for strings.
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.