pub struct QueryEngine<'a> { /* private fields */ }Expand description
Query engine for graph traversal and analysis.
Implementations§
Source§impl<'a> QueryEngine<'a>
impl<'a> QueryEngine<'a>
pub fn new(graph: &'a Graph) -> Self
Sourcepub fn impact(&self, node_id: &str) -> Vec<&'a Node>
pub fn impact(&self, node_id: &str) -> Vec<&'a Node>
Impact analysis: what nodes are affected if node_id changes?
Follows reverse dependency edges (who depends on this node?).
Traverses all edge relations by default.
Sourcepub fn impact_filtered(
&self,
node_id: &str,
relations: Option<&[&str]>,
) -> Vec<&'a Node>
pub fn impact_filtered( &self, node_id: &str, relations: Option<&[&str]>, ) -> Vec<&'a Node>
Impact analysis with optional relation filter.
If relations is None, traverses all edge types.
Sourcepub fn deps(&self, node_id: &str, transitive: bool) -> Vec<&'a Node>
pub fn deps(&self, node_id: &str, transitive: bool) -> Vec<&'a Node>
Dependencies: what does node_id depend on? (transitive)
Traverses all edge relations by default.
Sourcepub fn deps_filtered(
&self,
node_id: &str,
transitive: bool,
relations: Option<&[&str]>,
) -> Vec<&'a Node>
pub fn deps_filtered( &self, node_id: &str, transitive: bool, relations: Option<&[&str]>, ) -> Vec<&'a Node>
Dependencies with optional relation filter.
If relations is None, traverses all edge types.
Sourcepub fn path(&self, from: &str, to: &str) -> Option<Vec<String>>
pub fn path(&self, from: &str, to: &str) -> Option<Vec<String>>
Find shortest path between two nodes (any edge direction).
Sourcepub fn common_cause(&self, node_a: &str, node_b: &str) -> Vec<&'a Node>
pub fn common_cause(&self, node_a: &str, node_b: &str) -> Vec<&'a Node>
Common cause: find shared dependencies of two nodes.
Sourcepub fn topological_sort(&self) -> Result<Vec<String>>
pub fn topological_sort(&self) -> Result<Vec<String>>
Topological sort (returns error if cycle detected).
Auto Trait Implementations§
impl<'a> Freeze for QueryEngine<'a>
impl<'a> RefUnwindSafe for QueryEngine<'a>
impl<'a> Send for QueryEngine<'a>
impl<'a> Sync for QueryEngine<'a>
impl<'a> Unpin for QueryEngine<'a>
impl<'a> UnsafeUnpin for QueryEngine<'a>
impl<'a> UnwindSafe for QueryEngine<'a>
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