pub trait Query {
type Id: Copy + Eq + HashWork;
type Document: Copy + Eq;
type Generation: Copy + Eq;
type Work: Work;
// Required methods
fn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>;
fn execution(&self) -> &Self::Work;
fn admit(
&self,
node: Self::Id,
units: u64,
) -> Result<(), ScopeError<Self::Id>>;
// Provided method
fn equal(
&self,
left: Self::Id,
right: Self::Id,
) -> Result<bool, MemoryError> { ... }
}Expand description
One current query over one expected source snapshot.
Every long-term validation check runs under the query that performs it:
retained facts are never prepaid work. A format layer implements this over
its own access guard, so its checks and these share one admission path;
Scope implements it over any Source.
Required Associated Types§
Sourcetype Generation: Copy + Eq
type Generation: Copy + Eq
Exact document generation.
Required Methods§
Sourcefn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>
fn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>
The expected source snapshot of every fact checked in this query.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".