struct OffsetOrInlineView(u64);Expand description
Either offset to the dictionary page bytes or inline bytes when the bytes are short enough to avoid doing the indirection
For inlined view: +————+—————+——————————+ | 1 bit set | len {7 bits} | value {56 bits} | +————+—————+——————————+
For non-inlined view: +–––––––+––––––––––––––––––––––+ | 1 bit unset | offset in dict {63 bits} | +–––––––+––––––––––––––––––––––+
the inline view contain it’s length to avoid having another field for length in the entry since if the hashes are the same, most probably the length will be the same, so we can do the indirection check
Tuple Fields§
§0: u64Implementations§
Source§impl OffsetOrInlineView
impl OffsetOrInlineView
const INLINE_FLAG: u64
const LEN_SHIFT: u32 = 56
fn is_non_inlined(&self) -> bool
fn is_inlined(&self) -> bool
fn new_inlined(value: &[u8]) -> Self
fn new_non_inlined(offset: u64) -> Self
fn maybe_non_inlined_value(&self) -> Option<u64>
Trait Implementations§
Source§impl Clone for OffsetOrInlineView
impl Clone for OffsetOrInlineView
impl Copy for OffsetOrInlineView
Source§impl Debug for OffsetOrInlineView
impl Debug for OffsetOrInlineView
impl Eq for OffsetOrInlineView
Source§impl Hash for OffsetOrInlineView
impl Hash for OffsetOrInlineView
Source§impl PartialEq for OffsetOrInlineView
impl PartialEq for OffsetOrInlineView
impl StructuralPartialEq for OffsetOrInlineView
Auto Trait Implementations§
impl Freeze for OffsetOrInlineView
impl RefUnwindSafe for OffsetOrInlineView
impl Send for OffsetOrInlineView
impl Sync for OffsetOrInlineView
impl Unpin for OffsetOrInlineView
impl UnsafeUnpin for OffsetOrInlineView
impl UnwindSafe for OffsetOrInlineView
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Checks if this value is equivalent to the given key. Read more
§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.