routing

Function route_capability

Source
pub async fn route_capability<C>(
    request: RouteRequest,
    target: &Arc<C>,
    mapper: &mut dyn DebugRouteMapper,
) -> Result<RouteSource, RoutingError>
where C: ComponentInstanceInterface + 'static,
Expand description

Performs a debug route from the target for the capability defined in request. The source of the route is returned if the route is valid, otherwise a routing error is returned.

If the capability is not allowed to be routed to the target, per the [crate::model::policy::GlobalPolicyChecker], then an error is returned.

This function will only be used for developer tools once the bedrock routing refactor has been completed, but for now it’s the only way to route capabilities which are unsupported in bedrock.

For capabilities which are not supported in bedrock, the mapper is invoked on every step in the routing process and can be used to record the routing steps. Once all capabilities are supported in bedrock routing, the mapper argument will be removed.