pub struct DotFunMap<V> { /* private fields */ }Expand description
A map from Dot to V: DotStore, whose computed dots is the union of the dots of its
values.
Quoth the DSON paper:
We combine the
DotMapandDotFunto get a dot store which maps dots to dot stores. The join operation keeps keys that have not been deleted (as in theDotFun), or the values themselves haven’t been deleted (as in theDotMap).
Note that this is called CompDotFun in the DSON paper (section 5.1), but DotFunMap in their
prototype implementation.
Implementations§
Source§impl<V> DotFunMap<V>
impl<V> DotFunMap<V>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Constructs a DotFunMap with the given initial capacity.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = (Dot, &V)>
pub fn iter(&self) -> impl ExactSizeIterator<Item = (Dot, &V)>
Produces an iterator over the map’s keys and values.
Sourcepub fn keys(&self) -> impl ExactSizeIterator<Item = Dot> + '_
pub fn keys(&self) -> impl ExactSizeIterator<Item = Dot> + '_
Produces an iterator over the map’s keys.
Sourcepub fn values(&self) -> impl ExactSizeIterator<Item = &V>
pub fn values(&self) -> impl ExactSizeIterator<Item = &V>
Produces an iterator over the map’s values.
Trait Implementations§
Source§impl<'de, V> Deserialize<'de> for DotFunMap<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for DotFunMap<V>where
V: 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<V> DotStore for DotFunMap<V>
impl<V> DotStore for DotFunMap<V>
Source§fn add_dots_to(&self, other: &mut CausalContext)
fn add_dots_to(&self, other: &mut CausalContext)
other. Read moreSource§fn subset_for_inflation_from(&self, frontier: &CausalContext) -> Self
fn subset_for_inflation_from(&self, frontier: &CausalContext) -> Self
self that allows inflating state at the vector time
frontier to what’s in self.Source§fn dots(&self) -> CausalContext
fn dots(&self) -> CausalContext
Source§impl<V, S> DotStoreJoin<S> for DotFunMap<V>
impl<V, S> DotStoreJoin<S> for DotFunMap<V>
Source§fn join(
(m1, cc1): (Self, &CausalContext),
(m2, cc2): (Self, &CausalContext),
on_dot_change: &mut dyn FnMut(DotChange),
sentinel: &mut S,
) -> Result<Self, S::Error>where
S: Sentinel,
fn join(
(m1, cc1): (Self, &CausalContext),
(m2, cc2): (Self, &CausalContext),
on_dot_change: &mut dyn FnMut(DotChange),
sentinel: &mut S,
) -> Result<Self, S::Error>where
S: Sentinel,
Formally (Equation 7):
(𝑚, 𝑐) ⊔ (𝑚′, 𝑐′) = ( {𝑑 ↦ 𝑣(𝑑) | 𝑑 ∈ dom 𝑚 ∩ dom 𝑚′ ∧ 𝑣(𝑑) ≠ ⊥} ∪ {(𝑑, 𝑣) ∈ 𝑚 | 𝑑 ∉ 𝑐′} ∪ {(𝑑, 𝑣) ∈ 𝑚′ | 𝑑 ∉ 𝑐} , 𝑐 ∪ 𝑐′ ) where 𝑣(𝑑) = fst((𝑚(𝑑), 𝑐) ⊔ (𝑚′(𝑑), 𝑐′))
Informally:
- for dots in both stores, join the values and keep non-bottoms
- for dots in store 1 that haven’t beeen observed by store 2, keep the value
- for dots in store 2 that haven’t beeen observed by store 1, keep the value
- don’t keep other dots
- the resulting causal context is the union of the provided causal contexts
Source§fn dry_join(
(m1, cc1): (&Self, &CausalContext),
(m2, cc2): (&Self, &CausalContext),
sentinel: &mut S,
) -> Result<DryJoinOutput, S::Error>where
S: Sentinel,
fn dry_join(
(m1, cc1): (&Self, &CausalContext),
(m2, cc2): (&Self, &CausalContext),
sentinel: &mut S,
) -> Result<DryJoinOutput, S::Error>where
S: Sentinel,
DotStoreJoin::join without constructing the output of the join. Read more