Skip to main content

GraphStore

Trait GraphStore 

Source
pub trait GraphStore {
Show 25 methods // Required methods fn upsert_node(&self, node: &GraphNode) -> Result<()>; fn upsert_edge(&self, edge: &GraphEdge) -> Result<()>; fn delete_node(&self, id: &str) -> Result<usize>; fn delete_edge( &self, from_id: &str, to_id: &str, kind: &str, ) -> Result<usize>; fn node(&self, id: &str) -> Result<Option<GraphNode>>; fn all_nodes(&self) -> Result<Vec<GraphNode>>; fn all_edges(&self) -> Result<Vec<GraphEdge>>; fn nodes_by_kind(&self, kind: &str) -> Result<Vec<GraphNode>>; fn outgoing_edges( &self, from_id: &str, kind: Option<&str>, ) -> Result<Vec<GraphEdge>>; fn shortest_path( &self, from_id: &str, to_id: &str, kind: Option<&str>, ) -> Result<Option<GraphPath>>; // Provided methods fn edge(&self, edge_id: &str) -> Result<Option<GraphEdge>> { ... } fn graph_counts(&self) -> Result<(usize, usize)> { ... } fn sample_edge(&self, kind: Option<&str>) -> Result<Option<GraphEdge>> { ... } fn sample_edge_with_property( &self, ) -> Result<Option<(GraphEdge, GraphPropertyFilter)>> { ... } fn incident_edges( &self, node_id: &str, kind: Option<&str>, ) -> Result<Vec<GraphEdge>> { ... } fn paged_edges( &self, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph> { ... } fn paged_incident_edges( &self, node_id: &str, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph> { ... } fn edges_between_nodes( &self, node_ids: &BTreeSet<String>, ) -> Result<Vec<GraphEdge>> { ... } fn shortest_path_with_max_hops( &self, from_id: &str, to_id: &str, kind: Option<&str>, max_hops: Option<usize>, ) -> Result<Option<GraphPath>> { ... } fn neighborhood( &self, center_id: &str, depth: usize, kind: Option<&str>, ) -> Result<Option<GraphSubgraph>> { ... } fn paged_nodes_by_kind( &self, kind: &str, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph> { ... } fn paged_neighborhood( &self, center_id: &str, depth: usize, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<Option<GraphPagedSubgraph>> { ... } fn reachable_nodes_by_kind( &self, from_id: &str, kind: &str, depth: usize, limit: usize, ) -> Result<Vec<(GraphNode, GraphPath)>> { ... } fn reachable_nodes_by_kinds( &self, from_id: &str, kinds: &[&str], depth: usize, limit: usize, ) -> Result<BTreeMap<String, Vec<(GraphNode, GraphPath)>>> { ... } fn resolve_evidence_target( &self, target: &str, kinds: &[&str], ) -> Result<Option<GraphNode>> { ... }
}

Required Methods§

Source

fn upsert_node(&self, node: &GraphNode) -> Result<()>

Source

fn upsert_edge(&self, edge: &GraphEdge) -> Result<()>

Source

fn delete_node(&self, id: &str) -> Result<usize>

Source

fn delete_edge(&self, from_id: &str, to_id: &str, kind: &str) -> Result<usize>

Source

fn node(&self, id: &str) -> Result<Option<GraphNode>>

Source

fn all_nodes(&self) -> Result<Vec<GraphNode>>

Source

fn all_edges(&self) -> Result<Vec<GraphEdge>>

Source

fn nodes_by_kind(&self, kind: &str) -> Result<Vec<GraphNode>>

Source

fn outgoing_edges( &self, from_id: &str, kind: Option<&str>, ) -> Result<Vec<GraphEdge>>

Source

fn shortest_path( &self, from_id: &str, to_id: &str, kind: Option<&str>, ) -> Result<Option<GraphPath>>

Provided Methods§

Source

fn edge(&self, edge_id: &str) -> Result<Option<GraphEdge>>

Source

fn graph_counts(&self) -> Result<(usize, usize)>

Source

fn sample_edge(&self, kind: Option<&str>) -> Result<Option<GraphEdge>>

Source

fn sample_edge_with_property( &self, ) -> Result<Option<(GraphEdge, GraphPropertyFilter)>>

Source

fn incident_edges( &self, node_id: &str, kind: Option<&str>, ) -> Result<Vec<GraphEdge>>

Source

fn paged_edges( &self, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph>

Source

fn paged_incident_edges( &self, node_id: &str, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph>

Source

fn edges_between_nodes( &self, node_ids: &BTreeSet<String>, ) -> Result<Vec<GraphEdge>>

Source

fn shortest_path_with_max_hops( &self, from_id: &str, to_id: &str, kind: Option<&str>, max_hops: Option<usize>, ) -> Result<Option<GraphPath>>

Source

fn neighborhood( &self, center_id: &str, depth: usize, kind: Option<&str>, ) -> Result<Option<GraphSubgraph>>

Source

fn paged_nodes_by_kind( &self, kind: &str, options: GraphQueryOptions, ) -> Result<GraphPagedSubgraph>

Source

fn paged_neighborhood( &self, center_id: &str, depth: usize, kind: Option<&str>, options: GraphQueryOptions, ) -> Result<Option<GraphPagedSubgraph>>

Source

fn reachable_nodes_by_kind( &self, from_id: &str, kind: &str, depth: usize, limit: usize, ) -> Result<Vec<(GraphNode, GraphPath)>>

Source

fn reachable_nodes_by_kinds( &self, from_id: &str, kinds: &[&str], depth: usize, limit: usize, ) -> Result<BTreeMap<String, Vec<(GraphNode, GraphPath)>>>

Source

fn resolve_evidence_target( &self, target: &str, kinds: &[&str], ) -> Result<Option<GraphNode>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§