fn all_target_capability_names<T, U>(in_obj: &T, to_obj: &U) -> Option<OneOrMany<cml::Name>>
where
    T: cml::CapabilityClause,
    U: cml::AsClause + cml::PathClause,
{
    if let Some(as_) = to_obj.r#as() {
        // We've already validated that when `as` is specified, only 1 source id exists.
        Some(OneOrMany::One(as_.clone()))
    } else {
        if let Some(n) = in_obj.service() {
            Some(n.clone())
        } else if let Some(n) = in_obj.protocol() {
            Some(n.clone())
        } else if let Some(n) = in_obj.directory() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.storage() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.runner() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.resolver() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.event() {
            Some(n.clone())
        } else {
            None
        }
    }
}
/// Return the target names or paths specified in the given capability.
Return the target names or paths specified in the given capability.
Return the target names or paths specified in the given capability .
fn all_target_capability_names<T, U>(in_obj: &T, to_obj: &U) -> Option<OneOrMany<cml::Name>>
where
    T: cml::CapabilityClause,
    U: cml::AsClause + cml::PathClause,
{
    if let Some(as_) = to_obj.r#as() {
        // We've already validated that when `as` is specified, only 1 source id exists.
        Some(OneOrMany::One(as_.clone()))
    } else {
        if let Some(n) = in_obj.service() {
            Some(n.clone())
        } else if let Some(n) = in_obj.protocol() {
            Some(n.clone())
        } else if let Some(n) = in_obj.directory() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.storage() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.runner() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.resolver() {
            Some(OneOrMany::One(n.clone()))
        } else if let Some(n) = in_obj.event() {
            Some(n.clone())
        } else {
            None
        }
    }
}
fn all_target_capability_names < T , U > ( in_obj : & T , to_obj : & U ) -> Option < OneOrMany < cml :: Name > > where T : cml :: CapabilityClause , U : cml :: AsClause + cml :: PathClause , { if let Some ( as_ ) = to_obj . r#as ( ) { // We've already validated that when `as` is specified, only 1 source id exists. Some ( OneOrMany :: One ( as_ . clone ( ) ) ) } else { if let Some ( n ) = in_obj . service ( ) { Some ( n . clone ( ) ) } else if let Some ( n ) = in_obj . protocol ( ) { Some ( n . clone ( ) ) } else if let Some ( n ) = in_obj . directory ( ) { Some ( OneOrMany :: One ( n . clone ( ) ) ) } else if let Some ( n ) = in_obj . storage ( ) { Some ( OneOrMany :: One ( n . clone ( ) ) ) } else if let Some ( n ) = in_obj . runner ( ) { Some ( OneOrMany :: One ( n . clone ( ) ) ) } else if let Some ( n ) = in_obj . resolver ( ) { Some ( OneOrMany :: One ( n . clone ( ) ) ) } else if let Some ( n ) = in_obj . event ( ) { Some ( n . clone ( ) ) } else { None } } }
Return the target names or paths specified in the given capability.
Return the target names or paths specified in the given capability .
in_obj
&T
to_obj
&U
in_obj
&T
to_obj
&U