pub unsafe trait LenHeader:
Into<usize>
+ Copy
+ Ord {
type Bytes;
// Required methods
fn to_le_bytes(&self) -> Self::Bytes;
fn from_le_bytes(by: Self::Bytes) -> Self;
}Expand description
A trait that can be used as the “header” for separating framed storage.
Framed interfaces use a u16 by default, which only requires two bytes
for the header, with the limitation that the largest grant allowed is
64KiB at a time. You can also use a usize allowing the maximum platform
available size.
You should not have to implement this trait.
§Safety
Do it right
Required Associated Types§
Required Methods§
Sourcefn to_le_bytes(&self) -> Self::Bytes
fn to_le_bytes(&self) -> Self::Bytes
Convert Self into Self::Bytes, in little endian order
Sourcefn from_le_bytes(by: Self::Bytes) -> Self
fn from_le_bytes(by: Self::Bytes) -> Self
Convert Self::Bytes (which is in little endian order) to Self.
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.