simple_triplestore/traits/
set.rs1use crate::{prelude::*, traits::IdType, traits::Property};
2
3#[derive(Debug)]
4pub enum SetOpsError<
5 LeftError: std::fmt::Debug,
6 RightError: std::fmt::Debug,
7 ResultError: std::fmt::Debug,
8> {
9 Left(LeftError),
10 Right(RightError),
11 Result(ResultError),
12}
13
14pub trait TripleStoreSetOps<Id: IdType, NodeProps: Property, EdgeProps: Property>:
18 TripleStoreError
19{
20 type SetOpsResult: TripleStore<Id, NodeProps, EdgeProps>;
22 type SetOpsResultError: std::fmt::Debug;
23
24 fn union<E: std::fmt::Debug>(
26 self,
27 other: impl TripleStoreIntoIter<Id, NodeProps, EdgeProps, Error = E>,
28 ) -> Result<Self::SetOpsResult, SetOpsError<Self::Error, E, Self::SetOpsResultError>>;
29
30 fn intersection<E: std::fmt::Debug>(
32 self,
33 other: impl TripleStoreIntoIter<Id, NodeProps, EdgeProps, Error = E>,
34 ) -> Result<Self::SetOpsResult, SetOpsError<Self::Error, E, Self::SetOpsResultError>>;
35
36 fn difference<E: std::fmt::Debug>(
38 self,
39 other: impl TripleStoreIntoIter<Id, NodeProps, EdgeProps, Error = E>,
40 ) -> Result<Self::SetOpsResult, SetOpsError<Self::Error, E, Self::SetOpsResultError>>;
41}