pub struct RouteDispatchPlan {
pub plugins: HashMap<String, RoutePluginEntry>,
pub delegation_entries: HashMap<String, HookEntry>,
}Expand description
A route’s resolved plugin lineup. One per (route_key, generation)
in the cache.
plugins holds entries for CMF-family dispatch (policy steps,
pipe-chain stages). delegation_entries holds entries for the
token.delegate hook used by Step::Delegate — kept separate
because the hook family is different and the dispatch is
per-call rather than per-route-chain.
Fields§
§plugins: HashMap<String, RoutePluginEntry>§delegation_entries: HashMap<String, HookEntry>Plugin name → resolved token.delegate hook entry for routes
that declared delegate(...) steps. Empty when the route has
no delegation. Built at plan time to avoid per-request
find_plugin_entries lookups in the hot path.
Implementations§
Source§impl RouteDispatchPlan
impl RouteDispatchPlan
Sourcepub async fn build(
route: &CompiledRoute,
registry: &PluginRegistry,
manager: &PluginManager,
) -> Self
pub async fn build( route: &CompiledRoute, registry: &PluginRegistry, manager: &PluginManager, ) -> Self
Build a plan for the given route. Walks all steps + pipeline stages, collects the unique set of plugin names, resolves each against cpex-core, and applies any APL route-level overrides.
Plugins referenced by APL but absent from cpex-core’s registry
(or absent from the APL plugins: block) are logged at warn
and excluded — dispatch then fails with PluginError::NotFound
when those plugins are invoked, which is the right behavior for
surfacing config drift.
Sourcepub fn get(&self, plugin_name: &str) -> Option<&RoutePluginEntry>
pub fn get(&self, plugin_name: &str) -> Option<&RoutePluginEntry>
Look up the resolved entries for a plugin by name. None when the plugin wasn’t referenced by the route (or was skipped during build due to config drift).
Sourcepub fn resolve_plugin(
manager: &PluginManager,
plugin_name: &str,
) -> Option<RoutePluginEntry>
pub fn resolve_plugin( manager: &PluginManager, plugin_name: &str, ) -> Option<RoutePluginEntry>
Resolve a single plugin’s entries straight off cpex-core, with
no APL route-level overrides. Convenience for tests and for hosts
that wire the invoker without a CompiledRoute in scope (e.g.
adapters that invoke a single plugin imperatively). Returns
None if cpex-core has no entries for the plugin.
Trait Implementations§
Source§impl Clone for RouteDispatchPlan
impl Clone for RouteDispatchPlan
Source§fn clone(&self) -> RouteDispatchPlan
fn clone(&self) -> RouteDispatchPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more