pub struct TribleSet {
pub eav: PATCH<TRIBLE_LEN, EAVOrder, ()>,
pub vea: PATCH<TRIBLE_LEN, VEAOrder, ()>,
pub ave: PATCH<TRIBLE_LEN, AVEOrder, ()>,
pub vae: PATCH<TRIBLE_LEN, VAEOrder, ()>,
pub eva: PATCH<TRIBLE_LEN, EVAOrder, ()>,
pub aev: PATCH<TRIBLE_LEN, AEVOrder, ()>,
}Expand description
A collection of Tribles.
A TribleSet is a collection of Tribles that can be queried and manipulated. It supports efficient set operations like union, intersection, and difference.
The stored Tribles are indexed by the six possible orderings of their fields in corresponding PATCHes.
Clone is extremely cheap and can be used to create a snapshot of the current state of the TribleSet.
Note that the TribleSet does not support an explicit delete/remove operation,
as this would conflict with the CRDT semantics of the TribleSet and CALM principles as a whole.
It does allow for set subtraction, but that operation is meant to compute the difference between two sets
and not to remove elements from the set. A subtle but important distinction.
Fields§
§eav: PATCH<TRIBLE_LEN, EAVOrder, ()>§vea: PATCH<TRIBLE_LEN, VEAOrder, ()>§ave: PATCH<TRIBLE_LEN, AVEOrder, ()>§vae: PATCH<TRIBLE_LEN, VAEOrder, ()>§eva: PATCH<TRIBLE_LEN, EVAOrder, ()>§aev: PATCH<TRIBLE_LEN, AEVOrder, ()>Implementations§
Source§impl TribleSet
impl TribleSet
pub fn intersect(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
pub fn new() -> TribleSet
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn fingerprint(&self) -> TribleSetFingerprint
pub fn fingerprint(&self) -> TribleSetFingerprint
Returns a fast fingerprint suitable for in-memory caching.
The fingerprint matches TribleSet equality, but it is not stable
across process boundaries because PATCH uses a per-process hash key.
pub fn insert(&mut self, trible: &Trible)
pub fn contains(&self, trible: &Trible) -> bool
pub fn iter(&self) -> TribleSetIterator<'_>
Trait Implementations§
Source§impl AddAssign for TribleSet
impl AddAssign for TribleSet
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<U> From<&SuccinctArchive<U>> for TribleSetwhere
U: Universe,
impl<U> From<&SuccinctArchive<U>> for TribleSetwhere
U: Universe,
Source§fn from(archive: &SuccinctArchive<U>) -> Self
fn from(archive: &SuccinctArchive<U>) -> Self
Source§impl<U> From<&TribleSet> for SuccinctArchive<U>
impl<U> From<&TribleSet> for SuccinctArchive<U>
Source§impl From<&TribleSet> for TribleSetFingerprint
impl From<&TribleSet> for TribleSetFingerprint
Source§impl FromIterator<Trible> for TribleSet
impl FromIterator<Trible> for TribleSet
Source§impl<'a> IntoIterator for &'a TribleSet
impl<'a> IntoIterator for &'a TribleSet
Source§impl ToBlob<SimpleArchive> for &TribleSet
impl ToBlob<SimpleArchive> for &TribleSet
fn to_blob(self) -> Blob<SimpleArchive>
Source§impl ToBlob<SimpleArchive> for TribleSet
impl ToBlob<SimpleArchive> for TribleSet
fn to_blob(self) -> Blob<SimpleArchive>
Source§impl TriblePattern for TribleSet
impl TriblePattern for TribleSet
Source§type PatternConstraint<'a> = TribleSetConstraint
type PatternConstraint<'a> = TribleSetConstraint
Source§fn pattern<V: ValueSchema>(
&self,
e: Variable<GenId>,
a: Variable<GenId>,
v: Variable<V>,
) -> Self::PatternConstraint<'static>
fn pattern<V: ValueSchema>( &self, e: Variable<GenId>, a: Variable<GenId>, v: Variable<V>, ) -> Self::PatternConstraint<'static>
Source§impl TryFromBlob<SimpleArchive> for TribleSet
impl TryFromBlob<SimpleArchive> for TribleSet
type Error = UnarchiveError
fn try_from_blob(blob: Blob<SimpleArchive>) -> Result<Self, Self::Error>
impl Eq for TribleSet
Auto Trait Implementations§
impl Freeze for TribleSet
impl RefUnwindSafe for TribleSet
impl Send for TribleSet
impl Sync for TribleSet
impl Unpin for TribleSet
impl UnwindSafe for TribleSet
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more