pub async fn route_from_use<C, V>(
    use_decl: UseDecl,
    use_target: Arc<C>,
    sources: Sources,
    visitor: &mut V,
    mapper: &mut dyn DebugRouteMapper
) -> Result<CapabilitySource<C>, RoutingError>
Expand description

Routes a capability from its Use declaration to its source by following Offer and Expose declarations.

sources defines what are the valid sources of the capability. See AllowedSourcesBuilder. visitor is invoked for each Offer and Expose declaration in the routing path, as well as the final Capability declaration if sources permits.