pub struct MapUnionWithTombstones<Map, TombstoneSet> { /* private fields */ }
Expand description
Map-union-with-tombstones compound lattice.
When a key is deleted from the map-union-with-tombstones lattice, it is removed from the underlying map
and placed into
the tombstones
set.
This forms the first invariant for this data structure. A key should appear either nowhere, in map
or in tombstones
.
but never in map
and tombstones
at the same time.
merging is done by merging the underlying map
and then merging the tombstones
set, then doing map
= map
- tombstones
.
The implementation of tombstones
can be any set-like thing. This allows a user to plug in their own set-like implementation.
For example, if the user knows that keys will be created and deleted strictly sequentially, then they could create a highly optimized set implementation
which would just be a single integer, correpsonding to the current key value that the set is up to. Queries for keys below that integer would return true,
queries for keys above it would return false.
Implementations§
source§impl<Map, TombstoneSet> MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> MapUnionWithTombstones<Map, TombstoneSet>
sourcepub fn new(map: Map, tombstones: TombstoneSet) -> Self
pub fn new(map: Map, tombstones: TombstoneSet) -> Self
Create a new MapUnionWithTombstones
from a Map
and a TombstoneSet
.
sourcepub fn new_from(
map: impl Into<Map>,
tombstones: impl Into<TombstoneSet>,
) -> Self
pub fn new_from( map: impl Into<Map>, tombstones: impl Into<TombstoneSet>, ) -> Self
Create a new MapUnionWithTombstones
from an Into<Map>
and an Into<TombstoneSet>
.
sourcepub fn as_reveal_ref(&self) -> (&Map, &TombstoneSet)
pub fn as_reveal_ref(&self) -> (&Map, &TombstoneSet)
Reveal the inner value as a shared reference.
sourcepub fn as_reveal_mut(&mut self) -> (&mut Map, &mut TombstoneSet)
pub fn as_reveal_mut(&mut self) -> (&mut Map, &mut TombstoneSet)
Reveal the inner value as an exclusive reference.
sourcepub fn into_reveal(self) -> (Map, TombstoneSet)
pub fn into_reveal(self) -> (Map, TombstoneSet)
Gets the inner by value, consuming self.
Trait Implementations§
source§impl<Map: Clone, TombstoneSet: Clone> Clone for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map: Clone, TombstoneSet: Clone> Clone for MapUnionWithTombstones<Map, TombstoneSet>
source§fn clone(&self) -> MapUnionWithTombstones<Map, TombstoneSet>
fn clone(&self) -> MapUnionWithTombstones<Map, TombstoneSet>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Map: Default, TombstoneSet: Default> Default for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map: Default, TombstoneSet: Default> Default for MapUnionWithTombstones<Map, TombstoneSet>
source§fn default() -> MapUnionWithTombstones<Map, TombstoneSet>
fn default() -> MapUnionWithTombstones<Map, TombstoneSet>
source§impl<'de, Map, TombstoneSet> Deserialize<'de> for MapUnionWithTombstones<Map, TombstoneSet>where
Map: Deserialize<'de>,
TombstoneSet: Deserialize<'de>,
impl<'de, Map, TombstoneSet> Deserialize<'de> for MapUnionWithTombstones<Map, TombstoneSet>where
Map: Deserialize<'de>,
TombstoneSet: 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<Map, TombstoneSet> IsBot for MapUnionWithTombstones<Map, TombstoneSet>where
Map: Iter,
Map::Item: IsBot,
TombstoneSet: Len,
impl<Map, TombstoneSet> IsBot for MapUnionWithTombstones<Map, TombstoneSet>where
Map: Iter,
Map::Item: IsBot,
TombstoneSet: Len,
source§impl<Map, TombstoneSet> IsTop for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> IsTop for MapUnionWithTombstones<Map, TombstoneSet>
source§impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> LatticeFrom<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + FromIterator<(K, ValSelf)>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: LatticeFrom<ValOther>,
TombstoneSetSelf: FromIterator<K>,
TombstoneSetOther: IntoIterator<Item = K>,
impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> LatticeFrom<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + FromIterator<(K, ValSelf)>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: LatticeFrom<ValOther>,
TombstoneSetSelf: FromIterator<K>,
TombstoneSetOther: IntoIterator<Item = K>,
source§fn lattice_from(
other: MapUnionWithTombstones<MapOther, TombstoneSetOther>,
) -> Self
fn lattice_from( other: MapUnionWithTombstones<MapOther, TombstoneSetOther>, ) -> Self
Other
lattice into Self
.source§impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> Merge<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + Extend<(K, ValSelf)> + for<'a> GetMut<&'a K, Item = ValSelf> + for<'b> Remove<&'b K>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
ValOther: IsBot,
TombstoneSetSelf: Extend<K> + Len + for<'a> Get<&'a K> + Iter<Item = K>,
TombstoneSetOther: IntoIterator<Item = K>,
impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> Merge<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + Extend<(K, ValSelf)> + for<'a> GetMut<&'a K, Item = ValSelf> + for<'b> Remove<&'b K>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
ValOther: IsBot,
TombstoneSetSelf: Extend<K> + Len + for<'a> Get<&'a K> + Iter<Item = K>,
TombstoneSetOther: IntoIterator<Item = K>,
source§fn merge(
&mut self,
other: MapUnionWithTombstones<MapOther, TombstoneSetOther>,
) -> bool
fn merge( &mut self, other: MapUnionWithTombstones<MapOther, TombstoneSetOther>, ) -> bool
source§fn merge_owned(this: Self, delta: Other) -> Selfwhere
Self: Sized,
fn merge_owned(this: Self, delta: Other) -> Selfwhere
Self: Sized,
this
and delta
together, returning the new value.source§impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> PartialEq<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Map<K, ValSelf, Key = K, Item = ValSelf> + MapIter + SimpleKeyedRef,
MapOther: Map<K, ValOther, Key = K, Item = ValOther> + MapIter + SimpleKeyedRef,
ValSelf: PartialEq<ValOther> + IsBot,
ValOther: IsBot,
TombstoneSetSelf: Len + Iter<Item = K> + for<'a> Get<&'a K>,
TombstoneSetOther: Len + Iter<Item = K> + for<'b> Get<&'b K>,
impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> PartialEq<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Map<K, ValSelf, Key = K, Item = ValSelf> + MapIter + SimpleKeyedRef,
MapOther: Map<K, ValOther, Key = K, Item = ValOther> + MapIter + SimpleKeyedRef,
ValSelf: PartialEq<ValOther> + IsBot,
ValOther: IsBot,
TombstoneSetSelf: Len + Iter<Item = K> + for<'a> Get<&'a K>,
TombstoneSetOther: Len + Iter<Item = K> + for<'b> Get<&'b K>,
source§fn eq(
&self,
other: &MapUnionWithTombstones<MapOther, TombstoneSetOther>,
) -> bool
fn eq( &self, other: &MapUnionWithTombstones<MapOther, TombstoneSetOther>, ) -> bool
self
and other
values to be equal, and is used by ==
.source§impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> PartialOrd<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Map<K, ValSelf, Key = K, Item = ValSelf> + MapIter + SimpleKeyedRef,
MapOther: Map<K, ValOther, Key = K, Item = ValOther> + MapIter + SimpleKeyedRef,
ValSelf: PartialOrd<ValOther> + IsBot,
ValOther: IsBot,
TombstoneSetSelf: Len + Iter<Item = K> + for<'a> Get<&'a K>,
TombstoneSetOther: Len + Iter<Item = K> + for<'a> Get<&'a K>,
impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> PartialOrd<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Map<K, ValSelf, Key = K, Item = ValSelf> + MapIter + SimpleKeyedRef,
MapOther: Map<K, ValOther, Key = K, Item = ValOther> + MapIter + SimpleKeyedRef,
ValSelf: PartialOrd<ValOther> + IsBot,
ValOther: IsBot,
TombstoneSetSelf: Len + Iter<Item = K> + for<'a> Get<&'a K>,
TombstoneSetOther: Len + Iter<Item = K> + for<'a> Get<&'a K>,
source§impl<Map, TombstoneSet> Serialize for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> Serialize for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map: Copy, TombstoneSet: Copy> Copy for MapUnionWithTombstones<Map, TombstoneSet>
impl<MapSelf, TombstoneSetSelf> Eq for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
Self: PartialEq,
impl<MapSelf, MapOther, TombstoneSetSelf, TombstoneSetOther> LatticeOrd<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
Self: PartialOrd<MapUnionWithTombstones<MapOther, TombstoneSetOther>>,
Auto Trait Implementations§
impl<Map, TombstoneSet> Freeze for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> RefUnwindSafe for MapUnionWithTombstones<Map, TombstoneSet>where
Map: RefUnwindSafe,
TombstoneSet: RefUnwindSafe,
impl<Map, TombstoneSet> Send for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> Sync for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> Unpin for MapUnionWithTombstones<Map, TombstoneSet>
impl<Map, TombstoneSet> UnwindSafe for MapUnionWithTombstones<Map, TombstoneSet>where
Map: UnwindSafe,
TombstoneSet: 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