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>
impl<Set, TombstoneSet> SetUnionWithTombstones<Set, TombstoneSet>
sourcepub fn new(set: Set, tombstones: TombstoneSet) -> Self
pub fn new(set: Set, tombstones: TombstoneSet) -> Self
Create a new SetUnionWithTombstones
from a Set
and TombstoneSet
.
sourcepub fn new_from(
set: impl Into<Set>,
tombstones: impl Into<TombstoneSet>,
) -> Self
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>
.
sourcepub fn as_reveal_ref(&self) -> (&Set, &TombstoneSet)
pub fn as_reveal_ref(&self) -> (&Set, &TombstoneSet)
Reveal the inner value as a shared reference.
sourcepub fn as_reveal_mut(&mut self) -> (&mut Set, &mut TombstoneSet)
pub fn as_reveal_mut(&mut self) -> (&mut Set, &mut TombstoneSet)
Reveal the inner value as an exclusive reference.
sourcepub fn into_reveal(self) -> (Set, TombstoneSet)
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>
impl<Set: Clone, TombstoneSet: Clone> Clone for SetUnionWithTombstones<Set, TombstoneSet>
source§fn clone(&self) -> SetUnionWithTombstones<Set, TombstoneSet>
fn clone(&self) -> SetUnionWithTombstones<Set, TombstoneSet>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Set: Default, TombstoneSet: Default> Default for SetUnionWithTombstones<Set, TombstoneSet>
impl<Set: Default, TombstoneSet: Default> Default for SetUnionWithTombstones<Set, TombstoneSet>
source§fn default() -> SetUnionWithTombstones<Set, TombstoneSet>
fn default() -> SetUnionWithTombstones<Set, TombstoneSet>
source§impl<Set, TombstoneSet> IsBot for SetUnionWithTombstones<Set, TombstoneSet>where
Set: Len,
TombstoneSet: Len,
impl<Set, TombstoneSet> IsBot for SetUnionWithTombstones<Set, TombstoneSet>where
Set: Len,
TombstoneSet: Len,
source§impl<Set, TombstoneSet> IsTop for SetUnionWithTombstones<Set, TombstoneSet>
impl<Set, TombstoneSet> IsTop for SetUnionWithTombstones<Set, TombstoneSet>
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>,
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
fn lattice_from( other: SetUnionWithTombstones<SetOther, TombstoneSetOther>, ) -> Self
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>,
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
fn merge( &mut self, other: SetUnionWithTombstones<SetOther, 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<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,
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
fn eq( &self, other: &SetUnionWithTombstones<SetOther, TombstoneSetOther>, ) -> bool
self
and other
values to be equal, and is used by ==
.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,
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,
impl<SetSelf, TombstoneSetSelf> Eq for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>where
Self: PartialEq,
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>
impl<Set, TombstoneSet> RefUnwindSafe for SetUnionWithTombstones<Set, TombstoneSet>where
Set: RefUnwindSafe,
TombstoneSet: RefUnwindSafe,
impl<Set, TombstoneSet> Send for SetUnionWithTombstones<Set, TombstoneSet>
impl<Set, TombstoneSet> Sync for SetUnionWithTombstones<Set, TombstoneSet>
impl<Set, TombstoneSet> Unpin for SetUnionWithTombstones<Set, TombstoneSet>
impl<Set, TombstoneSet> UnwindSafe for SetUnionWithTombstones<Set, TombstoneSet>where
Set: 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