pub struct DependencyGraph {
pub startup_order: Vec<String>,
pub edges: BTreeMap<String, Vec<DependencyEdge>>,
pub dependents: BTreeMap<String, Vec<String>>,
}Expand description
A resolved dependency graph with startup ordering.
Fields§
§startup_order: Vec<String>Services in topological order (dependencies first).
edges: BTreeMap<String, Vec<DependencyEdge>>For each service, the services it must wait for.
dependents: BTreeMap<String, Vec<String>>Reverse map: for each service, the services that depend on it.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn resolve(config: &TopologyConfig) -> Result<Self>
pub fn resolve(config: &TopologyConfig) -> Result<Self>
Resolve dependencies from a topology config into a startup-ordered graph.
Returns an error if circular dependencies are detected.
Sourcepub fn shutdown_order(&self) -> Vec<String>
pub fn shutdown_order(&self) -> Vec<String>
Get the shutdown order (reverse of startup order).
Trait Implementations§
Source§impl Clone for DependencyGraph
impl Clone for DependencyGraph
Source§fn clone(&self) -> DependencyGraph
fn clone(&self) -> DependencyGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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