pub struct GraphStorage { /* private fields */ }Expand description
Storage backend for graph database
Implementations§
Source§impl GraphStorage
impl GraphStorage
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create or open a graph storage at the given path
Uses a global connection pool to allow multiple GraphStorage instances to share the same underlying database file
Sourcepub fn insert_node(&self, node: &Node) -> Result<NodeId>
pub fn insert_node(&self, node: &Node) -> Result<NodeId>
Insert a node
Sourcepub fn insert_nodes_batch(&self, nodes: &[Node]) -> Result<Vec<NodeId>>
pub fn insert_nodes_batch(&self, nodes: &[Node]) -> Result<Vec<NodeId>>
Insert multiple nodes in a batch
Sourcepub fn delete_node(&self, id: &str) -> Result<bool>
pub fn delete_node(&self, id: &str) -> Result<bool>
Delete a node by ID
Sourcepub fn all_node_ids(&self) -> Result<Vec<NodeId>>
pub fn all_node_ids(&self) -> Result<Vec<NodeId>>
Get all node IDs
Sourcepub fn insert_edge(&self, edge: &Edge) -> Result<EdgeId>
pub fn insert_edge(&self, edge: &Edge) -> Result<EdgeId>
Insert an edge
Sourcepub fn insert_edges_batch(&self, edges: &[Edge]) -> Result<Vec<EdgeId>>
pub fn insert_edges_batch(&self, edges: &[Edge]) -> Result<Vec<EdgeId>>
Insert multiple edges in a batch
Sourcepub fn delete_edge(&self, id: &str) -> Result<bool>
pub fn delete_edge(&self, id: &str) -> Result<bool>
Delete an edge by ID
Sourcepub fn all_edge_ids(&self) -> Result<Vec<EdgeId>>
pub fn all_edge_ids(&self) -> Result<Vec<EdgeId>>
Get all edge IDs
Sourcepub fn insert_hyperedge(&self, hyperedge: &Hyperedge) -> Result<HyperedgeId>
pub fn insert_hyperedge(&self, hyperedge: &Hyperedge) -> Result<HyperedgeId>
Insert a hyperedge
Sourcepub fn insert_hyperedges_batch(
&self,
hyperedges: &[Hyperedge],
) -> Result<Vec<HyperedgeId>>
pub fn insert_hyperedges_batch( &self, hyperedges: &[Hyperedge], ) -> Result<Vec<HyperedgeId>>
Insert multiple hyperedges in a batch
Sourcepub fn delete_hyperedge(&self, id: &str) -> Result<bool>
pub fn delete_hyperedge(&self, id: &str) -> Result<bool>
Delete a hyperedge by ID
Sourcepub fn all_hyperedge_ids(&self) -> Result<Vec<HyperedgeId>>
pub fn all_hyperedge_ids(&self) -> Result<Vec<HyperedgeId>>
Get all hyperedge IDs
Sourcepub fn node_count(&self) -> Result<usize>
pub fn node_count(&self) -> Result<usize>
Get the number of nodes
Sourcepub fn edge_count(&self) -> Result<usize>
pub fn edge_count(&self) -> Result<usize>
Get the number of edges
Sourcepub fn hyperedge_count(&self) -> Result<usize>
pub fn hyperedge_count(&self) -> Result<usize>
Get the number of hyperedges
Auto Trait Implementations§
impl Freeze for GraphStorage
impl !RefUnwindSafe for GraphStorage
impl Send for GraphStorage
impl Sync for GraphStorage
impl Unpin for GraphStorage
impl !UnwindSafe for GraphStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request