pub struct SetUnionWithTombstones<Set, TombstoneSet> { /* private fields */ }
Expand description

Set-union lattice with tombstones.

When an item is deleted from the SetUnionWithTombstones, it is removed from set and added to tombstones. This also is an invariant, if an item appears in tombstones it must not also be in set.

Merging set-union lattices is done by unioning the keys of both the (set and tombstone) sets, and then performing set = set - tombstones, to preserve the above invariant.

TODO: I think there is even one more layer of abstraction that can be made here. this ‘SetUnionWithTombstones’ can be turned into a kind of interface, because there are multiple underlying implementations. This implementation is two separate sets. Another implementation could be MapUnion<Key, WithTop<()>>, this would be less hash lookups, but maybe gives you less options for cool storage tricks. This implementation with two separate sets means that the actual set implementation can be decided for both the regular set and the tombstone set. Lots of opportunities there for cool storage tricks.

Implementations§

source§

impl<Set, TombstoneSet> SetUnionWithTombstones<Set, TombstoneSet>

source

pub fn new(set: Set, tombstones: TombstoneSet) -> Self

Create a new SetUnionWithTombstones from a Set and TombstoneSet.

source

pub fn new_from( set: impl Into<Set>, tombstones: impl Into<TombstoneSet>, ) -> Self

Create a new SetUnionWithTombstones from an Into<Set> and an Into<TombstonesSet>.

source

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

Reveal the inner value as a shared reference.

source

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

Reveal the inner value as an exclusive reference.

source

pub fn into_reveal(self) -> (Set, TombstoneSet)

Gets the inner by value, consuming self.

Trait Implementations§

source§

impl<Set: Clone, TombstoneSet: Clone> Clone for SetUnionWithTombstones<Set, TombstoneSet>

source§

fn clone(&self) -> SetUnionWithTombstones<Set, 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<Set: Debug, TombstoneSet: Debug> Debug for SetUnionWithTombstones<Set, TombstoneSet>

source§

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

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

impl<Set: Default, TombstoneSet: Default> Default for SetUnionWithTombstones<Set, TombstoneSet>

source§

fn default() -> SetUnionWithTombstones<Set, TombstoneSet>

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

impl<Set, TombstoneSet> IsBot for SetUnionWithTombstones<Set, TombstoneSet>
where Set: Len, TombstoneSet: Len,

source§

fn is_bot(&self) -> bool

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

impl<Set, TombstoneSet> IsTop for SetUnionWithTombstones<Set, TombstoneSet>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl<SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther, Item> LatticeFrom<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where SetSelf: FromIterator<Item>, SetOther: IntoIterator<Item = Item>, TombstoneSetSelf: FromIterator<Item>, TombstoneSetOther: IntoIterator<Item = Item>,

source§

fn lattice_from( other: SetUnionWithTombstones<SetOther, TombstoneSetOther>, ) -> Self

Convert from the Other lattice into Self.
source§

impl<Item, SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther> Merge<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where SetSelf: Extend<Item> + Len + for<'a> Remove<&'a Item>, SetOther: IntoIterator<Item = Item>, TombstoneSetSelf: Extend<Item> + Len + for<'a> Get<&'a Item>, TombstoneSetOther: IntoIterator<Item = Item>,

source§

fn merge( &mut self, other: SetUnionWithTombstones<SetOther, 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<SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther, Item> PartialEq<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where SetSelf: Set<Item, Item = Item> + Iter, SetOther: Set<Item, Item = Item> + Iter, TombstoneSetSelf: Set<Item, Item = Item> + Iter, TombstoneSetOther: Set<Item, Item = Item> + Iter,

source§

fn eq( &self, other: &SetUnionWithTombstones<SetOther, TombstoneSetOther>, ) -> bool

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

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther, Item> PartialOrd<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where SetSelf: Set<Item, Item = Item> + Iter, SetOther: Set<Item, Item = Item> + Iter, TombstoneSetSelf: Set<Item, Item = Item> + Iter, TombstoneSetOther: Set<Item, Item = Item> + Iter,

source§

fn partial_cmp( &self, other: &SetUnionWithTombstones<SetOther, 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

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

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

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

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

impl<SetSelf, TombstoneSetSelf> Eq for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where Self: PartialEq,

source§

impl<SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther> LatticeOrd<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>
where Self: PartialOrd<SetUnionWithTombstones<SetOther, TombstoneSetOther>>,

Auto Trait Implementations§

§

impl<Set, TombstoneSet> Freeze for SetUnionWithTombstones<Set, TombstoneSet>
where Set: Freeze, TombstoneSet: Freeze,

§

impl<Set, TombstoneSet> RefUnwindSafe for SetUnionWithTombstones<Set, TombstoneSet>
where Set: RefUnwindSafe, TombstoneSet: RefUnwindSafe,

§

impl<Set, TombstoneSet> Send for SetUnionWithTombstones<Set, TombstoneSet>
where Set: Send, TombstoneSet: Send,

§

impl<Set, TombstoneSet> Sync for SetUnionWithTombstones<Set, TombstoneSet>
where Set: Sync, TombstoneSet: Sync,

§

impl<Set, TombstoneSet> Unpin for SetUnionWithTombstones<Set, TombstoneSet>
where Set: Unpin, TombstoneSet: Unpin,

§

impl<Set, TombstoneSet> UnwindSafe for SetUnionWithTombstones<Set, TombstoneSet>
where Set: 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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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,

source§

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

source§

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

source§

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> Lattice for T