async fn find_capability_source<'a>(
    model: &'a Model,
    capability: ComponentCapability,
    target_moniker: &'a AbsoluteMoniker,
) -> Result<CapabilitySource, ModelError> {
    let mut pos = WalkPosition {
        capability,
        last_child_moniker: target_moniker.path().last().map(|c| c.clone()),
        moniker: target_moniker.parent(),
    };
    if let Some(source) = walk_offer_chain(model, &mut pos).await? {
        return Ok(source);
    }
    walk_expose_chain(model, &mut pos).await
}
/// Walks the component tree to find the originating source of a capability, starting on the given
/// abs_moniker. It returns the absolute moniker of the originating component, a reference to its
/// realm, and the capability exposed or offered at the originating source. If the absolute moniker
/// and realm are None, then the capability originates at the returned path in componentmgr's
/// namespace.
Walks the component tree to find the originating source of a capability, starting on the given
abs_moniker. It returns the absolute moniker of the originating component, a reference to its
realm, and the capability exposed or offered at the originating source. If the absolute moniker
and realm are None, then the capability originates at the returned path in componentmgr's
namespace.
Walks the component tree to find the originating source of a capability starting on the given abs_moniker . It returns the absolute moniker of the originating component a reference to its realm and the capability exposed or offered at the originating source . If the absolute moniker and realm are None then the capability originates at the returned path in componentmgr ' s namespace .
async fn find_capability_source<'a>(
    model: &'a Model,
    capability: ComponentCapability,
    target_moniker: &'a AbsoluteMoniker,
) -> Result<CapabilitySource, ModelError> {
    let mut pos = WalkPosition {
        capability,
        last_child_moniker: target_moniker.path().last().map(|c| c.clone()),
        moniker: target_moniker.parent(),
    };
    if let Some(source) = walk_offer_chain(model, &mut pos).await? {
        return Ok(source);
    }
    walk_expose_chain(model, &mut pos).await
}
async fn find_capability_source < ' a > ( model : & ' a Model , capability : ComponentCapability , target_moniker : & ' a AbsoluteMoniker , ) -> Result < CapabilitySource , ModelError > { let mut pos = WalkPosition { capability , last_child_moniker : target_moniker . path ( ) . last ( ) . map ( | c | c . clone ( ) ) , moniker : target_moniker . parent ( ) , } ; if let Some ( source ) = walk_offer_chain ( model , & mut pos ) . await ? { return Ok ( source ) ; } walk_expose_chain ( model , & mut pos ) . await }
Walks the component tree to find the originating source of a capability, starting on the given
abs_moniker.
Walks the component tree to find the originating source of a capability starting on the given abs_moniker .
model
&'a Model
capability
ComponentCapability
target_moniker
&'a AbsoluteMoniker