pub trait ReasoningStore: Send {
type Term: Clone + Eq + Send + Sync;
type Error: Error + Send + Sync + 'static;
type Snapshot: TripleSource<Term = Self::Term, Error = Self::Error>;
// Required methods
fn resolve_iri(
&mut self,
iri: &str,
) -> impl Future<Output = Result<Self::Term, Self::Error>> + Send;
fn snapshot(
&mut self,
) -> impl Future<Output = Result<Self::Snapshot, Self::Error>> + Send;
fn contains(
&mut self,
triple: &[Self::Term; 3],
) -> impl Future<Output = Result<bool, Self::Error>> + Send;
fn insert_inferred(
&mut self,
inference: Inference<Self::Term>,
) -> impl Future<Output = Result<bool, Self::Error>> + Send;
fn is_cancelled(&self) -> bool;
}Expand description
Backend capabilities for one fresh, isolated inference attempt.
Initially expose only the caller’s selected asserted snapshot, never earlier inferred output. Scratch facts must spill to caller-owned indexed storage; no method may buffer a graph-sized relation. Each snapshot freezes the union as of its creation; subsequent insertions are visible in the next snapshot.
On any error the caller must discard/abort staged output. A successful run grants no publication authority: callers still check input currentness and atomically promote their owned inference contribution. Recompute from fresh assertions after deletion. The executor never mutates asserted input.
Required Associated Types§
Sourcetype Term: Clone + Eq + Send + Sync
type Term: Clone + Eq + Send + Sync
Exact RDF term identity; database IDs and backend RDF terms both work.
Sourcetype Error: Error + Send + Sync + 'static
type Error: Error + Send + Sync + 'static
Backend failure propagated without substituting an empty relation.
Sourcetype Snapshot: TripleSource<Term = Self::Term, Error = Self::Error>
type Snapshot: TripleSource<Term = Self::Term, Error = Self::Error>
Owned immutable view supporting concurrent outer/inner read cursors.
Required Methods§
Sourcefn resolve_iri(
&mut self,
iri: &str,
) -> impl Future<Output = Result<Self::Term, Self::Error>> + Send
fn resolve_iri( &mut self, iri: &str, ) -> impl Future<Output = Result<Self::Term, Self::Error>> + Send
Resolve a full rule-constant IRI as an IRI, never as a plain string literal.
Sourcefn snapshot(
&mut self,
) -> impl Future<Output = Result<Self::Snapshot, Self::Error>> + Send
fn snapshot( &mut self, ) -> impl Future<Output = Result<Self::Snapshot, Self::Error>> + Send
Freeze selected assertions plus all currently staged inferred tuples.
Sourcefn contains(
&mut self,
triple: &[Self::Term; 3],
) -> impl Future<Output = Result<bool, Self::Error>> + Send
fn contains( &mut self, triple: &[Self::Term; 3], ) -> impl Future<Output = Result<bool, Self::Error>> + Send
Indexed membership in the current asserted-plus-staged union.
Sourcefn insert_inferred(
&mut self,
inference: Inference<Self::Term>,
) -> impl Future<Output = Result<bool, Self::Error>> + Send
fn insert_inferred( &mut self, inference: Inference<Self::Term>, ) -> impl Future<Output = Result<bool, Self::Error>> + Send
Stage a novel inferred tuple with its first proof; assertions win duplicates.
Return true only for a new inferred tuple. Preserve generalized tuples
in scratch; do not silently drop terms or normalize literal lexical forms.
Sourcefn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Whether this attempt is cancelled/superseded. Awaited operations must also support cancellation through the backend’s own error/control boundary.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".