use crate::{
prelude::*,
traits::{IdType, Mergeable, Property},
Triple,
};
#[derive(Debug)]
pub enum MergeError<LeftError: std::fmt::Debug, RightError: std::fmt::Debug> {
Left(LeftError),
Right(RightError),
}
pub trait TripleStoreMerge<
Id: IdType,
NodeProps: Property + Mergeable,
EdgeProps: Property + Mergeable,
>: TripleStoreError
{
fn merge<E: std::fmt::Debug>(
&mut self,
other: impl TripleStore<Id, NodeProps, EdgeProps, Error = E>,
) -> Result<(), MergeError<Self::Error, E>>;
fn merge_node(&mut self, node: Id, props: NodeProps) -> Result<(), Self::Error>;
fn merge_edge(&mut self, triple: Triple<Id>, props: EdgeProps) -> Result<(), Self::Error>;
}