pub trait GraphStorage: Send + Sync {
Show 29 methods
// Required methods
fn begin_write(&self) -> GraphStoreResult<Box<dyn GraphWriteTransaction>>;
fn graph_names(&self) -> GraphStoreResult<Vec<String>>;
fn has_graph(&self, graph: &str) -> GraphStoreResult<bool>;
fn create_graph(&self, graph: &str) -> GraphStoreResult<()>;
fn delete_graph(&self, graph: &str) -> GraphStoreResult<()>;
fn registry(&self, graph: &str) -> GraphStoreResult<GraphLabelRegistry>;
fn save_registry(
&self,
graph: &str,
registry: &GraphLabelRegistry,
) -> GraphStoreResult<()>;
fn counter(&self, kind: GraphEntityKind) -> GraphStoreResult<Option<u64>>;
fn save_counter(
&self,
kind: GraphEntityKind,
next: u64,
) -> GraphStoreResult<()>;
fn vertex(&self, id: u64) -> GraphStoreResult<Option<Vertex>>;
fn edge(&self, id: u64) -> GraphStoreResult<Option<Edge>>;
fn save_vertex(&self, vertex: &Vertex) -> GraphStoreResult<()>;
fn save_edge(&self, edge: &Edge) -> GraphStoreResult<()>;
fn delete_vertex(&self, id: u64) -> GraphStoreResult<()>;
fn delete_edge(&self, id: u64) -> GraphStoreResult<()>;
fn ids(
&self,
filter: GraphEntityFilter<'_>,
after: Option<u64>,
limit: usize,
) -> GraphStoreResult<Vec<u64>>;
fn count(&self, filter: GraphEntityFilter<'_>) -> GraphStoreResult<u64>;
fn max_id(&self, kind: GraphEntityKind) -> GraphStoreResult<Option<u64>>;
fn memberships(
&self,
kind: GraphEntityKind,
id: u64,
) -> GraphStoreResult<Vec<String>>;
fn has_membership(
&self,
kind: GraphEntityKind,
id: u64,
graph: &str,
) -> GraphStoreResult<bool>;
fn attach(
&self,
kind: GraphEntityKind,
id: u64,
graph: &str,
) -> GraphStoreResult<()>;
fn detach(
&self,
kind: GraphEntityKind,
id: u64,
graph: &str,
) -> GraphStoreResult<()>;
// Provided methods
fn visit_selection_namespaces(
&self,
visit: &mut dyn FnMut(GraphIdentifierNamespace) -> GraphStoreResult<()>,
) -> GraphStoreResult<()> { ... }
fn entity_observation_namespace(
&self,
_kind: GraphEntityKind,
_id: u64,
) -> GraphStoreResult<Option<GraphIdentifierNamespace>> { ... }
fn identifiers(&self) -> GraphStoreResult<Option<GraphIdentifierScope<'_>>> { ... }
fn guard_definition(&self, _graph: Option<&str>) -> GraphStoreResult<()> { ... }
fn reset_identifiers(&self) -> GraphStoreResult<()> { ... }
fn fork_overlay(&self) -> Option<Arc<dyn GraphStorage>> { ... }
fn unmodified_read_snapshot(&self) -> Option<PersistentGraphStore> { ... }
}Expand description
No entity, membership, or adjacency collection is retained by a handle. Multi-read operations run in the caller’s pinned storage transaction.
Required Methods§
fn begin_write(&self) -> GraphStoreResult<Box<dyn GraphWriteTransaction>>
fn graph_names(&self) -> GraphStoreResult<Vec<String>>
fn has_graph(&self, graph: &str) -> GraphStoreResult<bool>
fn create_graph(&self, graph: &str) -> GraphStoreResult<()>
fn delete_graph(&self, graph: &str) -> GraphStoreResult<()>
fn registry(&self, graph: &str) -> GraphStoreResult<GraphLabelRegistry>
fn save_registry( &self, graph: &str, registry: &GraphLabelRegistry, ) -> GraphStoreResult<()>
fn counter(&self, kind: GraphEntityKind) -> GraphStoreResult<Option<u64>>
fn save_counter(&self, kind: GraphEntityKind, next: u64) -> GraphStoreResult<()>
fn vertex(&self, id: u64) -> GraphStoreResult<Option<Vertex>>
fn edge(&self, id: u64) -> GraphStoreResult<Option<Edge>>
fn save_vertex(&self, vertex: &Vertex) -> GraphStoreResult<()>
fn save_edge(&self, edge: &Edge) -> GraphStoreResult<()>
fn delete_vertex(&self, id: u64) -> GraphStoreResult<()>
fn delete_edge(&self, id: u64) -> GraphStoreResult<()>
fn ids( &self, filter: GraphEntityFilter<'_>, after: Option<u64>, limit: usize, ) -> GraphStoreResult<Vec<u64>>
fn count(&self, filter: GraphEntityFilter<'_>) -> GraphStoreResult<u64>
fn max_id(&self, kind: GraphEntityKind) -> GraphStoreResult<Option<u64>>
fn memberships( &self, kind: GraphEntityKind, id: u64, ) -> GraphStoreResult<Vec<String>>
fn has_membership( &self, kind: GraphEntityKind, id: u64, graph: &str, ) -> GraphStoreResult<bool>
fn attach( &self, kind: GraphEntityKind, id: u64, graph: &str, ) -> GraphStoreResult<()>
fn detach( &self, kind: GraphEntityKind, id: u64, graph: &str, ) -> GraphStoreResult<()>
Provided Methods§
Sourcefn visit_selection_namespaces(
&self,
visit: &mut dyn FnMut(GraphIdentifierNamespace) -> GraphStoreResult<()>,
) -> GraphStoreResult<()>
fn visit_selection_namespaces( &self, visit: &mut dyn FnMut(GraphIdentifierNamespace) -> GraphStoreResult<()>, ) -> GraphStoreResult<()>
A selection can combine an original snapshot with private entities from another clear generation. Visit each physical namespace supplying that view without observing provider validation reads.
Sourcefn entity_observation_namespace(
&self,
_kind: GraphEntityKind,
_id: u64,
) -> GraphStoreResult<Option<GraphIdentifierNamespace>>
fn entity_observation_namespace( &self, _kind: GraphEntityKind, _id: u64, ) -> GraphStoreResult<Option<GraphIdentifierNamespace>>
Select the same physical identity generation as the entity read. An overlay may read untouched entities from its original snapshot and changed entities from its writer.
Sourcefn identifiers(&self) -> GraphStoreResult<Option<GraphIdentifierScope<'_>>>
fn identifiers(&self) -> GraphStoreResult<Option<GraphIdentifierScope<'_>>>
Autonomous identifiers for this physical entity namespace and its current clear generation. Missing capability retains serialized counter updates.
fn guard_definition(&self, _graph: Option<&str>) -> GraphStoreResult<()>
Sourcefn reset_identifiers(&self) -> GraphStoreResult<()>
fn reset_identifiers(&self) -> GraphStoreResult<()>
Select a fresh durable namespace when clearing every graph and entity. Providers exposing identifiers must implement this transactionally.
Sourcefn fork_overlay(&self) -> Option<Arc<dyn GraphStorage>>
fn fork_overlay(&self) -> Option<Arc<dyn GraphStorage>>
Copy only transaction-local write identities when preparing a new command candidate. The underlying durable snapshots remain shared.
fn unmodified_read_snapshot(&self) -> Option<PersistentGraphStore>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".