Skip to main content

RelationshipGraphT

Trait RelationshipGraphT 

Source
pub trait RelationshipGraphT: Send + Sync {
    // Required methods
    fn get_node(&self, name: &str) -> Option<&GraphNode>;
    fn get_neighbors(&self, name: &str) -> Vec<&GraphNode>;
    fn get_edges(&self, name: &str) -> Vec<&GraphEdge>;
    fn search(&self, query: &str, limit: usize) -> Vec<&GraphNode>;
    fn find_path(&self, from: &str, to: &str) -> Option<Vec<String>>;
}
Expand description

Trait for querying a relationship graph.

Provides read-only access to the graph structure without coupling to a specific implementation.

Required Methods§

Source

fn get_node(&self, name: &str) -> Option<&GraphNode>

Get a node by name.

Source

fn get_neighbors(&self, name: &str) -> Vec<&GraphNode>

Get all neighbor nodes.

Source

fn get_edges(&self, name: &str) -> Vec<&GraphEdge>

Get all edges for a node.

Source

fn search(&self, query: &str, limit: usize) -> Vec<&GraphNode>

Search for nodes matching a query string.

Source

fn find_path(&self, from: &str, to: &str) -> Option<Vec<String>>

Find the shortest path between two nodes.

Implementors§