pub trait BeBytes: Sized {
type ByteArray: AsRef<[u8]>;
// Required methods
fn to_be_bytes(self) -> Self::ByteArray;
fn from_be_bytes(bytes: &[u8]) -> Option<Self>;
}Expand description
A trait for types that can be encoded to and decoded from big-endian bytes.
Required Associated Types§
Required Methods§
fn to_be_bytes(self) -> Self::ByteArray
fn from_be_bytes(bytes: &[u8]) -> Option<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.