pub struct HandlerCallGraph { /* private fields */ }Expand description
Build-time analysis structure for circular dependency detection
Feature T130 - Not Yet Integrated
This structure is used for static analysis of handler dependencies to detect circular call chains at compile time. It is not yet integrated into the handler registration or dispatch system.
§Example
ⓘ
use dampen_core::handler::HandlerCallGraph;
let mut graph = HandlerCallGraph::new();
graph.add_dependency("handler_a", "handler_b");
graph.add_dependency("handler_b", "handler_c");
if let Some(cycle) = graph.detect_cycles() {
println!("Circular dependency detected: {:?}", cycle);
}Implementations§
Source§impl HandlerCallGraph
impl HandlerCallGraph
Sourcepub fn add_dependency(&mut self, from: &str, to: &str)
pub fn add_dependency(&mut self, from: &str, to: &str)
Add a dependency edge (from depends on to)
Sourcepub fn would_create_cycle(&self, from: &str, to: &str) -> bool
pub fn would_create_cycle(&self, from: &str, to: &str) -> bool
Detect if adding edge would create a cycle
Sourcepub fn dependents_of(&self, handler: &str) -> Vec<String>
pub fn dependents_of(&self, handler: &str) -> Vec<String>
Get all handlers that depend on the given handler
Sourcepub fn detect_cycles(&self) -> Option<Vec<String>>
pub fn detect_cycles(&self) -> Option<Vec<String>>
Detect cycles in the call graph using DFS
Trait Implementations§
Source§impl Clone for HandlerCallGraph
impl Clone for HandlerCallGraph
Source§fn clone(&self) -> HandlerCallGraph
fn clone(&self) -> HandlerCallGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HandlerCallGraph
impl Debug for HandlerCallGraph
Auto Trait Implementations§
impl Freeze for HandlerCallGraph
impl RefUnwindSafe for HandlerCallGraph
impl Send for HandlerCallGraph
impl Sync for HandlerCallGraph
impl Unpin for HandlerCallGraph
impl UnwindSafe for HandlerCallGraph
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