pub unsafe trait Storable: Ord + 'static {
type AlignedRef<'a>: Deref<Target = Self> + PointerIntoOwned;
type BytesRef<'a>: Deref<Target = [u8]>
where
Self: 'a;
const CONST_BYTES_LEN: bool;
const OPTIMIZE_INT: bool = false;
const TRIVIAL_CMP: bool = false;
fn to_bytes(&self) -> Self::BytesRef<'_>;
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> Self::AlignedRef<'_>;
fn bytes_len(&self) -> usize { ... }
unsafe fn cmp_bytes_unchecked(a: &[u8], b: &[u8]) -> Ordering { ... }
}
Expand description
Types that can be stored
Required Associated Types
type AlignedRef<'a>: Deref<Target = Self> + PointerIntoOwned
type AlignedRef<'a>: Deref<Target = Self> + PointerIntoOwned
Pointer to aligned version of Self
Required Associated Constants
const CONST_BYTES_LEN: bool
const CONST_BYTES_LEN: bool
Does byte representation have fixed length?
Provided Associated Constants
const OPTIMIZE_INT: bool = false
const OPTIMIZE_INT: bool = false
const TRIVIAL_CMP: bool = false
const TRIVIAL_CMP: bool = false
Is Ord
consistent with lexicographical sorting of binary representation?
Required Methods
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> Self::AlignedRef<'_>
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> Self::AlignedRef<'_>
Converts from byte slice