pub struct DomPair<Key, Val> {
pub key: Key,
/* private fields */
}Expand description
Dominating pair compound lattice.
When merging if one Key (usually a timestamp) fully dominates (is greater than) the other,
then both that Key and corresponding Val are selected. If the Keys are equal or
incomparable, then both the Keys and Vals are merged.
Key specifies the key lattice (usually a timestamp), and Val specifies the value lattice.
Note that this is not a proper lattice, it fails associativity. However it will behave like a
proper lattice if Key is a totally ordered lattice or a properly formed vector clock lattice.
The exact meaning of “properly formed” is still TBD, but each node always incrementing its
entry for each operation sent should be sufficient.
Fields§
§key: KeyThe Key of the dominating pair lattice, usually a timestamp.
This field is public as it is always monotonically increasing in its lattice.
Implementations§
Source§impl<Key, Val> DomPair<Key, Val>
impl<Key, Val> DomPair<Key, Val>
Sourcepub fn new_from(key: impl Into<Key>, val: impl Into<Val>) -> Self
pub fn new_from(key: impl Into<Key>, val: impl Into<Val>) -> Self
Create a DomPair from the given Into<Key> and Into<Val>.
Sourcepub fn as_reveal_ref(&self) -> (&Key, &Val)
pub fn as_reveal_ref(&self) -> (&Key, &Val)
Reveal the inner value as a shared reference.
Sourcepub fn as_reveal_mut(&mut self) -> (&mut Key, &mut Val)
pub fn as_reveal_mut(&mut self) -> (&mut Key, &mut Val)
Reveal the inner value as an exclusive reference.
Sourcepub fn into_reveal(self) -> (Key, Val)
pub fn into_reveal(self) -> (Key, Val)
Gets the inner by value, consuming self.
Trait Implementations§
Source§impl<Key, Val> DeepReveal for DomPair<Key, Val>where
Key: DeepReveal,
Val: DeepReveal,
impl<Key, Val> DeepReveal for DomPair<Key, Val>where
Key: DeepReveal,
Val: DeepReveal,
Source§type Revealed = (<Key as DeepReveal>::Revealed, <Val as DeepReveal>::Revealed)
type Revealed = (<Key as DeepReveal>::Revealed, <Val as DeepReveal>::Revealed)
Source§fn deep_reveal(self) -> Self::Revealed
fn deep_reveal(self) -> Self::Revealed
Source§impl<'de, Key, Val> Deserialize<'de> for DomPair<Key, Val>where
Key: Deserialize<'de>,
Val: Deserialize<'de>,
impl<'de, Key, Val> Deserialize<'de> for DomPair<Key, Val>where
Key: Deserialize<'de>,
Val: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<KeySelf, KeyOther, ValSelf, ValOther> LatticeFrom<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: LatticeFrom<KeyOther>,
ValSelf: LatticeFrom<ValOther>,
impl<KeySelf, KeyOther, ValSelf, ValOther> LatticeFrom<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: LatticeFrom<KeyOther>,
ValSelf: LatticeFrom<ValOther>,
Source§fn lattice_from(other: DomPair<KeyOther, ValOther>) -> Self
fn lattice_from(other: DomPair<KeyOther, ValOther>) -> Self
Other lattice into Self.Source§impl<KeySelf, KeyOther, ValSelf, ValOther> Merge<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: Merge<KeyOther> + LatticeFrom<KeyOther> + PartialOrd<KeyOther>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
impl<KeySelf, KeyOther, ValSelf, ValOther> Merge<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: Merge<KeyOther> + LatticeFrom<KeyOther> + PartialOrd<KeyOther>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
Source§impl<KeySelf, KeyOther, ValSelf, ValOther> PartialEq<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>
impl<KeySelf, KeyOther, ValSelf, ValOther> PartialEq<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>
Source§impl<KeySelf, KeyOther, ValSelf, ValOther> PartialOrd<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: PartialOrd<KeyOther>,
ValSelf: PartialOrd<ValOther>,
impl<KeySelf, KeyOther, ValSelf, ValOther> PartialOrd<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: PartialOrd<KeyOther>,
ValSelf: PartialOrd<ValOther>,
impl<Key: Copy, Val: Copy> Copy for DomPair<Key, Val>
impl<Key: Eq, Val: Eq> Eq for DomPair<Key, Val>
impl<KeySelf, KeyOther, ValSelf, ValOther> LatticeOrd<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
Self: PartialOrd<DomPair<KeyOther, ValOther>>,
Auto Trait Implementations§
impl<Key, Val> Freeze for DomPair<Key, Val>
impl<Key, Val> RefUnwindSafe for DomPair<Key, Val>where
Key: RefUnwindSafe,
Val: RefUnwindSafe,
impl<Key, Val> Send for DomPair<Key, Val>
impl<Key, Val> Sync for DomPair<Key, Val>
impl<Key, Val> Unpin for DomPair<Key, Val>
impl<Key, Val> UnwindSafe for DomPair<Key, Val>where
Key: UnwindSafe,
Val: 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
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
Source§impl<This, Other> NaiveLatticeOrd<Other> for This
impl<This, Other> NaiveLatticeOrd<Other> for This
Source§fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
Merge::merge method. This method can be very inefficient;
use PartialOrd::partial_cmp instead. Read more