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 Key
s are equal or
incomparable, then both the Key
s and Val
s 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: Key
The 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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