pub struct Entry<K, V> {
pub version: u64,
pub data: EntryData<K, V>,
}
Expand description
An entry can be persisted to the database.
Fields§
§version: u64
The version of the entry.
data: EntryData<K, V>
The data of the entry.
Implementations§
Source§impl<K, V> Entry<K, V>
impl<K, V> Entry<K, V>
Sourcepub const fn version(&self) -> u64
pub const fn version(&self) -> u64
Returns the version (can also be tought as transaction timestamp) of the entry.
Sourcepub fn into_components(self) -> (u64, EntryData<K, V>)
pub fn into_components(self) -> (u64, EntryData<K, V>)
Consumes the entry and returns the version and the entry data.
Sourcepub fn split(self) -> (K, EntryValue<V>)
pub fn split(self) -> (K, EntryValue<V>)
Split the entry into its key and EntryValue
.
Sourcepub fn unsplit(key: K, value: EntryValue<V>) -> Entry<K, V>
pub fn unsplit(key: K, value: EntryValue<V>) -> Entry<K, V>
Unsplit the key and EntryValue
into an entry.
Trait Implementations§
Source§impl<K, V> CheapClone for Entry<K, V>where
K: CheapClone,
V: CheapClone,
impl<K, V> CheapClone for Entry<K, V>where
K: CheapClone,
V: CheapClone,
Source§fn cheap_clone(&self) -> Entry<K, V>
fn cheap_clone(&self) -> Entry<K, V>
Returns a copy of the value.
Source§impl<K, V> Ord for Entry<K, V>
impl<K, V> Ord for Entry<K, V>
1.21.0 · 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, V> PartialOrd for Entry<K, V>
impl<K, V> PartialOrd for Entry<K, V>
impl<K, V> Eq for Entry<K, V>
impl<K, V> StructuralPartialEq for Entry<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Entry<K, V>
impl<K, V> RefUnwindSafe for Entry<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Entry<K, V>
impl<K, V> Sync for Entry<K, V>
impl<K, V> Unpin for Entry<K, V>
impl<K, V> UnwindSafe for Entry<K, V>where
K: UnwindSafe,
V: 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.