/// For a given ComponentDecl, parse it, identify capability dependencies
/// between children and collections in the ComponentDecl. A map is returned
/// which maps from a child to a set of other children to which that child
/// provides capabilities. The siblings to which the child offers capabilities
/// must be shut down before that child. This function panics if there is a
/// capability routing where either the source or target is not present in this
/// ComponentDecl. Panics are not expected because ComponentDecls should be
/// validated before this function is called.
For a given ComponentDecl, parse it, identify capability dependencies
between children and collections in the ComponentDecl. A map is returned
which maps from a child to a set of other children to which that child
provides capabilities. The siblings to which the child offers capabilities
must be shut down before that child. This function panics if there is a
capability routing where either the source or target is not present in this
ComponentDecl. Panics are not expected because ComponentDecls should be
validated before this function is called.
For a given ComponentDecl parse it identify capability dependencies between children and collections in the ComponentDecl . A map is returned which maps from a child to a set of other children to which that child provides capabilities . The siblings to which the child offers capabilities must be shut down before that child . This function panics if there is a capability routing where either the source or target is not present in this ComponentDecl . Panics are not expected because ComponentDecls should be validated before this function is called .
pub fn process_component_dependencies(decl: &ComponentDecl) -> DependencyMap {
    let mut dependency_map: DependencyMap = decl
        .children
        .iter()
        .map(|c| (DependencyNode::Child(c.name.clone()), HashSet::new()))
        .collect();
    dependency_map.extend(
        decl.collections
            .iter()
            .map(|c| (DependencyNode::Collection(c.name.clone()), HashSet::new())),
    );
    dependency_map.insert(DependencyNode::Parent, HashSet::new());
    get_dependencies_from_offers(decl, &mut dependency_map);
    get_dependencies_from_environments(decl, &mut dependency_map);
    get_dependencies_from_uses(decl, &mut dependency_map);
    dependency_map
}
pub fn process_component_dependencies ( decl : & ComponentDecl ) -> DependencyMap { let mut dependency_map : DependencyMap = decl . children . iter ( ) . map ( | c | ( DependencyNode :: Child ( c . name . clone ( ) ) , HashSet :: new ( ) ) ) . collect ( ) ; dependency_map . extend ( decl . collections . iter ( ) . map ( | c | ( DependencyNode :: Collection ( c . name . clone ( ) ) , HashSet :: new ( ) ) ) , ) ; dependency_map . insert ( DependencyNode :: Parent , HashSet :: new ( ) ) ; get_dependencies_from_offers ( decl , & mut dependency_map ) ; get_dependencies_from_environments ( decl , & mut dependency_map ) ; get_dependencies_from_uses ( decl , & mut dependency_map ) ; dependency_map }
For a given ComponentDecl, parse it, identify capability dependencies
between children and collections in the ComponentDecl.
For a given ComponentDecl parse it identify capability dependencies between children and collections in the ComponentDecl .
decl
&ComponentDecl