pub struct DependencyGraph { /* private fields */ }
Expand description
Dependency graph for analyzing service relationships
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn build_from_descriptors(descriptors: &[ServiceDescriptor]) -> Self
pub fn build_from_descriptors(descriptors: &[ServiceDescriptor]) -> Self
Build dependency graph from service descriptors
Sourcepub fn add_service(
&mut self,
service_id: &ServiceId,
dependencies: &[ServiceId],
)
pub fn add_service( &mut self, service_id: &ServiceId, dependencies: &[ServiceId], )
Add a service to the graph
Sourcepub fn detect_cycles(&self) -> Result<(), CoreError>
pub fn detect_cycles(&self) -> Result<(), CoreError>
Detect circular dependencies
Sourcepub fn topological_sort(&self) -> Result<Vec<ServiceId>, CoreError>
pub fn topological_sort(&self) -> Result<Vec<ServiceId>, CoreError>
Get topological order for dependency resolution
Sourcepub fn get_dependencies(&self, service_id: &ServiceId) -> Option<&[ServiceId]>
pub fn get_dependencies(&self, service_id: &ServiceId) -> Option<&[ServiceId]>
Get dependencies for a service
Sourcepub fn get_dependents(&self, service_id: &ServiceId) -> Option<&[ServiceId]>
pub fn get_dependents(&self, service_id: &ServiceId) -> Option<&[ServiceId]>
Get dependents for a service
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 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