Struct crdt_sample::dotcontext::DotContext
source · pub struct DotContext<K: PartialEq + Eq + Hash + Clone + Debug> {
pub cc: HashMap<K, i64>,
pub dc: HashSet<(K, i64)>,
}Expand description
Tries to optimize mapping. Source: https://github.com/CBaquero/delta-enabled-crdts/blob/master/delta-crdts.cc
Fields§
§cc: HashMap<K, i64>§dc: HashSet<(K, i64)>Implementations§
source§impl<K: PartialEq + Eq + Hash + Clone + Debug> DotContext<K>
impl<K: PartialEq + Eq + Hash + Clone + Debug> DotContext<K>
pub fn new() -> Self
sourcepub fn makedot(&mut self, id: &K) -> (K, i64)
pub fn makedot(&mut self, id: &K) -> (K, i64)
Creates a new dot considering that the dots are already compact.
sourcepub fn insert_dot(&mut self, dot: &(K, i64), compact: Option<bool>)
pub fn insert_dot(&mut self, dot: &(K, i64), compact: Option<bool>)
Adds a dot to the struct.
pub fn join(&mut self, other: &Self)
pub fn compact(&mut self)
Trait Implementations§
source§impl<K: Clone + PartialEq + Eq + Hash + Clone + Debug> Clone for DotContext<K>
impl<K: Clone + PartialEq + Eq + Hash + Clone + Debug> Clone for DotContext<K>
source§fn clone(&self) -> DotContext<K>
fn clone(&self) -> DotContext<K>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<K: PartialEq + PartialEq + Eq + Hash + Clone + Debug> PartialEq<DotContext<K>> for DotContext<K>
impl<K: PartialEq + PartialEq + Eq + Hash + Clone + Debug> PartialEq<DotContext<K>> for DotContext<K>
source§fn eq(&self, other: &DotContext<K>) -> bool
fn eq(&self, other: &DotContext<K>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.