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.
Trait Implementations§
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