pub trait BeBytes: Sized {
type ByteArray: AsRef<[u8]> + AsMut<[u8]> + Debug + Default + Copy + PartialEq + Eq + PartialOrd + Ord + Hash;
type Base32Array: AsRef<[u8]> + AsMut<[u8]> + Debug + Default + Copy + PartialEq + Eq + PartialOrd + Ord + Hash;
const SIZE: usize;
const BASE32_SIZE: usize;
// Required methods
fn to_be_bytes(self) -> Self::ByteArray;
fn from_be_bytes(bytes: Self::ByteArray) -> Self;
}Expand description
A trait for types that can be encoded to and decoded from big-endian bytes.
Required Associated Constants§
Required Associated Types§
type ByteArray: AsRef<[u8]> + AsMut<[u8]> + Debug + Default + Copy + PartialEq + Eq + PartialOrd + Ord + Hash
type Base32Array: AsRef<[u8]> + AsMut<[u8]> + Debug + Default + Copy + PartialEq + Eq + PartialOrd + Ord + Hash
Required Methods§
fn to_be_bytes(self) -> Self::ByteArray
fn from_be_bytes(bytes: Self::ByteArray) -> 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.