validate

Function validate 

Source
pub fn validate<'a>(
    decl: &'a Component,
    dependencies: &'a mut DirectedGraph<DependencyNode>,
) -> Result<(), ErrorList>
Expand description

Validates a Component.

The Component may ultimately originate from a CM file, or be directly constructed by the caller. Either way, a Component 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 only weak-dependency capabilities may be offered back to the component that exposed them.

dependencies is an output parameter that captures the capability dependency graph derived from decl. Callers may use this to traverse the capability graph in topological order.

All checks are local to this Component.