pub struct GraphDB { /* private fields */ }Expand description
High-performance graph database with concurrent access
Implementations§
Source§impl GraphDB
impl GraphDB
Sourcepub fn with_storage<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn with_storage<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new graph database with persistent storage
Sourcepub fn create_node(&self, node: Node) -> Result<NodeId>
pub fn create_node(&self, node: Node) -> Result<NodeId>
Create a node
Sourcepub fn get_nodes_by_label(&self, label: &str) -> Vec<Node>
pub fn get_nodes_by_label(&self, label: &str) -> Vec<Node>
Get nodes by label
Sourcepub fn get_nodes_by_property(
&self,
key: &str,
value: &PropertyValue,
) -> Vec<Node>
pub fn get_nodes_by_property( &self, key: &str, value: &PropertyValue, ) -> Vec<Node>
Get nodes by property
Sourcepub fn create_edge(&self, edge: Edge) -> Result<EdgeId>
pub fn create_edge(&self, edge: Edge) -> Result<EdgeId>
Create an edge
Sourcepub fn get_edges_by_type(&self, edge_type: &str) -> Vec<Edge>
pub fn get_edges_by_type(&self, edge_type: &str) -> Vec<Edge>
Get edges by type
Sourcepub fn get_outgoing_edges(&self, node_id: &NodeId) -> Vec<Edge>
pub fn get_outgoing_edges(&self, node_id: &NodeId) -> Vec<Edge>
Get outgoing edges from a node
Sourcepub fn get_incoming_edges(&self, node_id: &NodeId) -> Vec<Edge>
pub fn get_incoming_edges(&self, node_id: &NodeId) -> Vec<Edge>
Get incoming edges to a node
Sourcepub fn create_hyperedge(&self, hyperedge: Hyperedge) -> Result<HyperedgeId>
pub fn create_hyperedge(&self, hyperedge: Hyperedge) -> Result<HyperedgeId>
Create a hyperedge
Sourcepub fn get_hyperedge(&self, id: &HyperedgeId) -> Option<Hyperedge>
pub fn get_hyperedge(&self, id: &HyperedgeId) -> Option<Hyperedge>
Get a hyperedge by ID
Sourcepub fn get_hyperedges_by_node(&self, node_id: &NodeId) -> Vec<Hyperedge>
pub fn get_hyperedges_by_node(&self, node_id: &NodeId) -> Vec<Hyperedge>
Get hyperedges containing a node
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges
Sourcepub fn hyperedge_count(&self) -> usize
pub fn hyperedge_count(&self) -> usize
Get the number of hyperedges
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphDB
impl !RefUnwindSafe for GraphDB
impl Send for GraphDB
impl Sync for GraphDB
impl Unpin for GraphDB
impl !UnwindSafe for GraphDB
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