pub trait GraphStorage: Send + Sync {
Show 24 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 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 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".