pub struct Entry<K: Key> {
pub key: K,
pub offset: Offset,
}Expand description
Represents a Key-Value pair. Stored in leaf nodes and used as input for building.
Fields§
§key: KThe key part of the entry.
offset: OffsetThe value part of the entry (u64 offset).
Implementations§
Source§impl<K: Key> Entry<K>
impl<K: Key> Entry<K>
Sourcepub const SERIALIZED_SIZE: usize
pub const SERIALIZED_SIZE: usize
The total size of the entry when serialized.
pub fn new(key: K, offset: Offset) -> Self
Sourcepub fn write_to<W: Write>(&self, writer: &mut W) -> Result<usize>
pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<usize>
Serializes the entire entry (key followed by value) to a writer.
Assumes little-endian encoding for the Value.
Sourcepub fn from_reader<R: Read>(reader: &mut R) -> Result<Self>
pub fn from_reader<R: Read>(reader: &mut R) -> Result<Self>
Deserializes an entire entry from a reader.
Assumes little-endian encoding for the Value.
pub fn from_bytes(raw: &[u8]) -> Result<Self>
pub fn key_size() -> usize
Trait Implementations§
Source§impl<K: Key> Ord for Entry<K>
impl<K: Key> Ord for Entry<K>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: Key> PartialOrd for Entry<K>
impl<K: Key> PartialOrd for Entry<K>
impl<K: Eq + Key> Eq for Entry<K>
impl<K: Key> StructuralPartialEq for Entry<K>
Auto Trait Implementations§
impl<K> Freeze for Entry<K>where
K: Freeze,
impl<K> RefUnwindSafe for Entry<K>where
K: RefUnwindSafe,
impl<K> Send for Entry<K>where
K: Send,
impl<K> Sync for Entry<K>where
K: Sync,
impl<K> Unpin for Entry<K>where
K: Unpin,
impl<K> UnsafeUnpin for Entry<K>where
K: UnsafeUnpin,
impl<K> UnwindSafe for Entry<K>where
K: UnwindSafe,
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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.