Trait obkv::Key [−][src]
pub trait Key: Copy { type BYTES: AsRef<[u8]> + for<'a> TryFrom<&'a [u8]>; const BYTES_SIZE: usize; fn to_be_bytes(&self) -> Self::BYTES; fn from_be_bytes(array: Self::BYTES) -> Self; }
Expand description
A trait that represents a key, this key will be encoded to disk.
Associated Types
Associated Constants
const BYTES_SIZE: usize
const BYTES_SIZE: usize
The number of bytes the BYTES
array contains.
Required methods
fn to_be_bytes(&self) -> Self::BYTES
fn to_be_bytes(&self) -> Self::BYTES
Returns an array of the key bytes in big-endian.
fn from_be_bytes(array: Self::BYTES) -> Self
fn from_be_bytes(array: Self::BYTES) -> Self
Returns the key that corresponds to the given bytes array.