Module legacy_router

Source
Expand description

Each routing method’s name begins with route_*, and is an async function that returns Result<CapabilitySource, RoutingError>, i.e. finds the capability source by walking the route declarations and resolving components if necessary. Routing always walks in the direction from the consuming side to the providing side.

The most commonly used implementation is route_from_use, which starts from a Use declaration, walks along the chain of Offers, and then the chain of Exposes. Similarly, route_from_registration starts from a registration of a capability into an environment, then walks the Offers and Exposes.

You can also start walking from halfway in this chain, e.g. route_from_offer, route_from_expose.

Structs§

Expose
The Expose phase of routing.
NoopVisitor
Offer
The Offer phase of routing.
Registration
The environment Registration phase of routing.
RouteBundleIter
Immutable iterator over a RouteBundle. This struct is created by RouteBundle::iter.
Sources
Defines which capability source types are supported.
Use

Enums§

RouteBundle
A bundle of one or more routing declarations to route together, that share the same target_name

Traits§

CapabilityVisitor
Visitor pattern trait for visiting all CapabilityDecl during a route.
ErrorNotFoundFromParent
Implemented by declaration types to emit a proper error when a matching offer is not found in the parent.
ErrorNotFoundInChild
Implemented by declaration types to emit a proper error when a matching expose is not found in the child.
ExposeVisitor
Visitor pattern trait for visiting all ExposeDecl during a route.
OfferVisitor
Visitor pattern trait for visiting all OfferDecl during a route.

Functions§

find_matching_exposes
find_matching_offers
route_from_expose
Routes a capability from its Expose declaration to its source by following Expose declarations.
route_from_offer
Routes a capability from its Offer declaration to its source by following Offer and Expose declarations.
route_from_registration
Routes a capability from its environment Registration declaration to its source by following Offer and Expose declarations.
route_from_self
Routes a capability from its Use declaration to its source by capabilities declarations, i.e. whatever capabilities that this component itself provides.
route_from_self_by_name
Routes a capability from a capability name to its source by capabilities declarations, i.e. whatever capabilities that this component itself provides.
route_from_use
Routes a capability from its Use declaration to its source by following Offer and Expose declarations.