pub trait ToBeBytes {
type ByteArray: AsRef<[u8]>;
// Required methods
fn written_len(&self) -> usize;
fn to_be_bytes(&self) -> Self::ByteArray;
}Expand description
Helper traits for types which can be converted to a byte array.
Required Associated Types§
Required Methods§
Sourcefn written_len(&self) -> usize
fn written_len(&self) -> usize
Length when written to big endian bytes.
Sourcefn to_be_bytes(&self) -> Self::ByteArray
fn to_be_bytes(&self) -> Self::ByteArray
Convert to big endian byte array.