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>

source

pub fn new(map: Map, tombstones: TombstoneSet) -> Self

Create a new MapUnionWithTombstones from a Map and a TombstoneSet.

source

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>.

source

pub fn as_reveal_ref(&self) -> (&Map, &TombstoneSet)

Reveal the inner value as a shared reference.

source

pub fn as_reveal_mut(&mut self) -> (&mut Map, &mut TombstoneSet)

Reveal the inner value as an exclusive reference.

source

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>

source§

fn clone(&self) -> MapUnionWithTombstones<Map, TombstoneSet>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Map: Debug, TombstoneSet: Debug> Debug for MapUnionWithTombstones<Map, TombstoneSet>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Map: Default, TombstoneSet: Default> Default for MapUnionWithTombstones<Map, TombstoneSet>

source§

fn default() -> MapUnionWithTombstones<Map, TombstoneSet>

Returns the “default value” for a type. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Map, TombstoneSet> IsBot for MapUnionWithTombstones<Map, TombstoneSet>
where Map: Iter, Map::Item: IsBot, TombstoneSet: Len,

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl<Map, TombstoneSet> IsTop for MapUnionWithTombstones<Map, TombstoneSet>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
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>,

source§

fn lattice_from( other: MapUnionWithTombstones<MapOther, TombstoneSetOther> ) -> Self

Convert from the 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>,

source§

fn merge( &mut self, other: MapUnionWithTombstones<MapOther, TombstoneSetOther> ) -> bool

Merge other into the self lattice. Read more
source§

fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized,

Merge 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>,

source§

fn eq( &self, other: &MapUnionWithTombstones<MapOther, TombstoneSetOther> ) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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>,

source§

fn partial_cmp( &self, other: &MapUnionWithTombstones<MapOther, TombstoneSetOther> ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Map, TombstoneSet> Serialize for MapUnionWithTombstones<Map, TombstoneSet>
where Map: Serialize, TombstoneSet: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Map: Copy, TombstoneSet: Copy> Copy for MapUnionWithTombstones<Map, TombstoneSet>

source§

impl<MapSelf, TombstoneSetSelf> Eq for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>
where Self: PartialEq,

source§

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>
where Map: Freeze, TombstoneSet: Freeze,

§

impl<Map, TombstoneSet> RefUnwindSafe for MapUnionWithTombstones<Map, TombstoneSet>
where Map: RefUnwindSafe, TombstoneSet: RefUnwindSafe,

§

impl<Map, TombstoneSet> Send for MapUnionWithTombstones<Map, TombstoneSet>
where Map: Send, TombstoneSet: Send,

§

impl<Map, TombstoneSet> Sync for MapUnionWithTombstones<Map, TombstoneSet>
where Map: Sync, TombstoneSet: Sync,

§

impl<Map, TombstoneSet> Unpin for MapUnionWithTombstones<Map, TombstoneSet>
where Map: Unpin, TombstoneSet: Unpin,

§

impl<Map, TombstoneSet> UnwindSafe for MapUnionWithTombstones<Map, TombstoneSet>
where Map: UnwindSafe, TombstoneSet: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<This, Other> NaiveLatticeOrd<Other> for This
where This: Clone + Merge<Other>, Other: Clone + Merge<This>,

source§

fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>

Naive compare based on the Merge::merge method. This method can be very inefficient; use PartialOrd::partial_cmp instead. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Lattice for T