pub struct RoutePluginEntry {
pub plugin_name: String,
pub entries_by_hook: HashMap<String, HookEntry>,
}Expand description
Per-plugin pre-resolved entries for one route. Stores ALL hook
entries the plugin registered (keyed by hook name) so the
dispatcher can pick the right one for the current context via the
cpex-core hook routing table (hooks::metadata::lookup).
Replaces the prior step_entry / field_entry slot model, which
used a brittle naming heuristic to classify hooks and silently
collapsed plugins with multiple step-context hooks (e.g. both
tool_pre_invoke and tool_post_invoke) to a single entry.
Fields§
§plugin_name: String§entries_by_hook: HashMap<String, HookEntry>All hook entries the plugin registered, keyed by hook name.
Per-call overrides (route-level config / caps / on_error) are
already applied via build_override_entries before being
stored here.
Implementations§
Source§impl RoutePluginEntry
impl RoutePluginEntry
Sourcepub fn pick_entry(
&self,
requested_entity_type: Option<&str>,
requested_phase: HookPhase,
) -> Option<&HookEntry>
pub fn pick_entry( &self, requested_entity_type: Option<&str>, requested_phase: HookPhase, ) -> Option<&HookEntry>
Pick the entry whose registered hook matches the current
dispatch context. Walks entries_by_hook, consults the
cpex-core hook metadata table for each, returns the first
matching entry.
requested_entity_type comes from the request’s
MetaExtension.entity_type (or None if the dispatcher
doesn’t have one — in which case any hook’s entity_type
matches). requested_phase comes from the APL invocation
context — Pre for args: / policy:, Post for
result: / post_policy:, Unphased for unphased
dispatchers (rare in APL).
Returns None when the plugin has no hook matching the
context — caller surfaces this as PluginError::Dispatch
with the requested context in the message.
Trait Implementations§
Source§impl Clone for RoutePluginEntry
impl Clone for RoutePluginEntry
Source§fn clone(&self) -> RoutePluginEntry
fn clone(&self) -> RoutePluginEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more