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
pub fn get_bytes_size(&self) -> usize
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 duplicate 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 moreimpl<K: Eq + PartialEq + Eq + Hash + Clone + Debug> Eq for DotContext<K>
impl<K: PartialEq + Eq + Hash + Clone + Debug> StructuralPartialEq for DotContext<K>
Auto Trait Implementations§
impl<K> Freeze for DotContext<K>
impl<K> RefUnwindSafe for DotContext<K>where
K: RefUnwindSafe,
impl<K> Send for DotContext<K>where
K: Send,
impl<K> Sync for DotContext<K>where
K: Sync,
impl<K> Unpin for DotContext<K>where
K: Unpin,
impl<K> UnwindSafe for DotContext<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