routing::legacy_router

Function route_from_self

Source
pub async fn route_from_self<C, V>(
    use_decl: UseDecl,
    target: Arc<C>,
    sources: Sources,
    visitor: &mut V,
    mapper: &mut dyn DebugRouteMapper,
) -> Result<CapabilitySource, RoutingError>
where C: ComponentInstanceInterface + 'static, V: CapabilityVisitor + Clone + Send + Sync + 'static,
Expand description

Routes a capability from its Use declaration to its source by capabilities declarations, i.e. whatever capabilities that this component itself provides.

sources defines what are the valid sources of the capability. See Sources. visitor is invoked for each Capability declaration if sources permits.