// Return a list of (child, target capability id) expressed in the `offer`.
Return a list of (child, target capability id) expressed in the `offer`.
Return a list of ( child target capability id ) expressed in the ` offer ` .
fn extract_all_targets_for_each_child(
    in_obj: &cml::Offer,
    all_children: &HashSet<&cml::Name>,
    all_collections: &HashSet<&cml::Name>,
) -> Result<Vec<(fsys::Ref, cml::Name)>, Error> {
    let mut out_targets = vec![];
    let target_names = all_target_capability_names(in_obj, in_obj)
        .ok_or_else(|| Error::internal("no capability".to_string()))?;
    // Validate the "to" references.
    for to in &in_obj.to {
        for target_name in &target_names {
            let target =
                translate_child_or_collection_ref(to.into(), all_children, all_collections)?;
            out_targets.push((target, target_name.clone()))
        }
    }
    Ok(out_targets)
}
fn extract_all_targets_for_each_child ( in_obj : & cml :: Offer , all_children : & HashSet < & cml :: Name > , all_collections : & HashSet < & cml :: Name > , ) -> Result < Vec < ( fsys :: Ref , cml :: Name ) > , Error > { let mut out_targets = vec ! [ ] ; let target_names = all_target_capability_names ( in_obj , in_obj ) . ok_or_else ( | | Error :: internal ( " " . to_string ( ) ) ) ? ; // Validate the "to" references. for to in & in_obj . to { for target_name in & target_names { let target = translate_child_or_collection_ref ( to . into ( ) , all_children , all_collections ) ? ; out_targets . push ( ( target , target_name . clone ( ) ) ) } } Ok ( out_targets ) }
Return a list of (child, target capability id) expressed in the `offer`.
Return a list of ( child target capability id ) expressed in the ` offer ` .
in_obj
&cml::Offer
all_children
&HashSet<&cml::Name>
all_collections
&HashSet<&cml::Name>