pub enum KeyBlockLayout {
HashThenKey,
KeyOnly,
}Expand description
Whether a key block stores a hash per entry, and therefore what order its entries are in.
Variants§
HashThenKey
8-byte hash stored ahead of each key; entries sorted by (hash, key).
KeyOnly
No hash stored; entries sorted by key.
Implementations§
Source§impl KeyBlockLayout
impl KeyBlockLayout
Sourcepub fn hash_len(self) -> u8
pub fn hash_len(self) -> u8
Bytes each entry spends on its stored hash: 8, or 0 when the hash is omitted.
Sourcepub fn block_type(self, fixed: bool) -> u8
pub fn block_type(self, fixed: bool) -> u8
The on-disk block type byte for this layout, for fixed-size or variable-size entries.
Sourcepub fn from_block_type(block_type: u8) -> Option<(Self, bool)>
pub fn from_block_type(block_type: u8) -> Option<(Self, bool)>
Decodes a key block’s type byte into its layout, plus whether entries are fixed-size.
Returns None for a byte that is not a key block type.
Trait Implementations§
Source§impl Clone for KeyBlockLayout
impl Clone for KeyBlockLayout
Source§fn clone(&self) -> KeyBlockLayout
fn clone(&self) -> KeyBlockLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for KeyBlockLayout
Source§impl Debug for KeyBlockLayout
impl Debug for KeyBlockLayout
impl Eq for KeyBlockLayout
Source§impl PartialEq for KeyBlockLayout
impl PartialEq for KeyBlockLayout
impl StructuralPartialEq for KeyBlockLayout
Auto Trait Implementations§
impl Freeze for KeyBlockLayout
impl RefUnwindSafe for KeyBlockLayout
impl Send for KeyBlockLayout
impl Sync for KeyBlockLayout
impl Unpin for KeyBlockLayout
impl UnsafeUnpin for KeyBlockLayout
impl UnwindSafe for KeyBlockLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more