Skip to main content

GraphView

Trait GraphView 

Source
pub trait GraphView: Send + Sync {
    // Required methods
    fn neighbors(
        &self,
        node_id: &str,
        direction: GraphDirection,
        max_depth: usize,
    ) -> Result<Vec<GraphEdge>, MemoryError>;
    fn path(
        &self,
        from: &str,
        to: &str,
        max_depth: usize,
    ) -> Result<Option<Vec<String>>, MemoryError>;
}
Expand description

Trait for querying the memory store as a graph.

Required Methods§

Source

fn neighbors( &self, node_id: &str, direction: GraphDirection, max_depth: usize, ) -> Result<Vec<GraphEdge>, MemoryError>

Find neighboring nodes up to max_depth hops away.

Source

fn path( &self, from: &str, to: &str, max_depth: usize, ) -> Result<Option<Vec<String>>, MemoryError>

Find a path between two nodes (BFS, max depth).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§