pub struct DependencyGraph { /* private fields */ }Expand description
Dependency graph for topological sort and cycle detection.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn validate(&self) -> Result<Vec<TypeId>, GraphError>
pub fn validate(&self) -> Result<Vec<TypeId>, GraphError>
Validate the graph: check for missing dependencies and cycles.
Returns the topologically sorted TypeIds on success.
§Errors
Returns GraphError::DependencyMissing if a module depends on an unregistered module.
Returns GraphError::CycleDetected if a dependency cycle is found.
Sourcepub fn dependency_names(&self, type_id: TypeId) -> Vec<&'static str>
pub fn dependency_names(&self, type_id: TypeId) -> Vec<&'static str>
Get the registered names of all dependencies for a module.
Sourcepub fn entries(&self) -> &[ModuleEntry]
pub fn entries(&self) -> &[ModuleEntry]
Get all entries in registration order.
Sourcepub fn name_of(&self, type_id: TypeId) -> Option<&'static str>
pub fn name_of(&self, type_id: TypeId) -> Option<&'static str>
Look up a module’s diagnostic name by TypeId in O(1).
Sourcepub fn to_dot(&self) -> String
pub fn to_dot(&self) -> String
Export the dependency graph as a Graphviz DOT format string.
Nodes are module names; directed edges represent dependencies (dependency → dependent).
Sourcepub fn to_mermaid(&self) -> String
pub fn to_mermaid(&self) -> String
Export the dependency graph as a Mermaid flowchart format string.
Uses graph TD (top-down) layout. Edges: dependency –> dependent.
Trait Implementations§
Source§impl Debug for DependencyGraph
impl Debug for DependencyGraph
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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