pub trait QueryDatabase: Send + Sync {
// Required methods
fn current_revision(&self) -> Revision;
fn increment_revision(&self) -> Revision;
fn mark_in_progress(&self, id: QueryId);
fn unmark_in_progress(&self, id: QueryId);
fn is_in_progress(&self, id: QueryId) -> bool;
fn record_dependency(&self, from: QueryId, to: QueryId);
}Expand description
The central database trait that all query databases must implement.
Required Methods§
Sourcefn current_revision(&self) -> Revision
fn current_revision(&self) -> Revision
Get the current revision of the database.
Sourcefn increment_revision(&self) -> Revision
fn increment_revision(&self) -> Revision
Increment the revision (called when inputs change).
Sourcefn mark_in_progress(&self, id: QueryId)
fn mark_in_progress(&self, id: QueryId)
Mark a query as in-progress (for cycle detection).
Sourcefn unmark_in_progress(&self, id: QueryId)
fn unmark_in_progress(&self, id: QueryId)
Unmark a query as in-progress.
Sourcefn is_in_progress(&self, id: QueryId) -> bool
fn is_in_progress(&self, id: QueryId) -> bool
Check if a query is in progress (cycle detection).
Sourcefn record_dependency(&self, from: QueryId, to: QueryId)
fn record_dependency(&self, from: QueryId, to: QueryId)
Record a dependency from the current query to another.