pub fn validate(decl: &fsys::ComponentDecl) -> Result<(), ErrorList> {
    let ctx = ValidationContext {
        decl,
        all_children: HashSet::new(),
        all_collections: HashSet::new(),
        all_storage_and_sources: HashMap::new(),
        all_runners_and_sources: HashMap::new(),
        all_resolvers: HashSet::new(),
        all_environment_names: HashSet::new(),
        target_paths: HashMap::new(),
        offered_runner_names: HashMap::new(),
        offered_resolver_names: HashMap::new(),
        errors: vec![],
    };
    ctx.validate().map_err(|errs| ErrorList::new(errs))
}
/// Validates a ComponentDecl.
///
/// The ComponentDecl may ultimately originate from a CM file, or be directly constructed by the
/// caller. Either way, a ComponentDecl should always be validated before it's used. Examples
/// of what is validated (which may evolve in the future):
///
/// - That all semantically required fields are present
/// - That a child_name referenced in a source actually exists in the list of children
/// - That there are no duplicate target paths.
/// - That a cap is not offered back to the child that exposed it.
///
/// All checks are local to this ComponentDecl.


That all semantically required fields are present
That a child_name referenced in a source actually exists in the list of children
That there are no duplicate target paths.
That a cap is not offered back to the child that exposed it.

All checks are local to this ComponentDecl.
That all semantically required fields are present That a child_name referenced in a source actually exists in the list of children That there are no duplicate target paths . That a cap is not offered back to the child that exposed it . All checks are local to this ComponentDecl .
pub fn validate(decl: &fsys::ComponentDecl) -> Result<(), ErrorList> {
    let ctx = ValidationContext {
        decl,
        all_children: HashSet::new(),
        all_collections: HashSet::new(),
        all_storage_and_sources: HashMap::new(),
        all_runners_and_sources: HashMap::new(),
        all_resolvers: HashSet::new(),
        all_environment_names: HashSet::new(),
        target_paths: HashMap::new(),
        offered_runner_names: HashMap::new(),
        offered_resolver_names: HashMap::new(),
        errors: vec![],
    };
    ctx.validate().map_err(|errs| ErrorList::new(errs))
}
pub fn validate ( decl : & fsys :: ComponentDecl ) -> Result < ( ) , ErrorList > { let ctx = ValidationContext { decl , all_children : HashSet :: new ( ) , all_collections : HashSet :: new ( ) , all_storage_and_sources : HashMap :: new ( ) , all_runners_and_sources : HashMap :: new ( ) , all_resolvers : HashSet :: new ( ) , all_environment_names : HashSet :: new ( ) , target_paths : HashMap :: new ( ) , offered_runner_names : HashMap :: new ( ) , offered_resolver_names : HashMap :: new ( ) , errors : vec ! [ ] , } ; ctx . validate ( ) . map_err ( | errs | ErrorList :: new ( errs ) ) }
Validates a ComponentDecl.
Validates a ComponentDecl .
decl
&fsys::ComponentDecl
decl
&fsys::ComponentDecl