pub struct EffectivePlugin<'a> {
pub name: &'a str,
pub kind: &'a str,
pub hooks: &'a [String],
pub capabilities: CapsView<'a>,
pub config: Option<&'a Value>,
pub on_error: Option<&'a str>,
}Expand description
Plugin shape after layering route-level overrides on top of the
global declaration. This is what invokers should consume — calling
EffectivePlugin::resolve (rather than reading the global directly)
ensures future override enforcement lands without re-walking the
dispatch sites.
Fields§
§name: &'a str§kind: &'a str§hooks: &'a [String]NOT overridable per spec — always from the global declaration.
capabilities: CapsView<'a>Capabilities: route override wins if present, else global.
Borrowed when no override applies; owned (cloned) when override
present. Use [capabilities] to read regardless.
config: Option<&'a Value>Config: route override wins if present, else global. Borrowed
directly; callers that need to own it call .cloned().
on_error: Option<&'a str>on_error: route override wins if present, else global.
Implementations§
Source§impl<'a> EffectivePlugin<'a>
impl<'a> EffectivePlugin<'a>
Sourcepub fn resolve(
name: &str,
registry: &'a PluginRegistry,
route_overrides: &'a HashMap<String, PluginOverride>,
) -> Option<Self>
pub fn resolve( name: &str, registry: &'a PluginRegistry, route_overrides: &'a HashMap<String, PluginOverride>, ) -> Option<Self>
Merge a global declaration with a per-route override and return
the effective view. Returns None if name isn’t in the
registry — caller decides whether that’s an error.
Spec §“Route-Level Plugin Config Overrides”:
- Override
configreplaces the globalconfigentirely. - Override
capabilitiesreplaces global capabilities. - Override
on_errorreplaces global on_error. - Everything else inherits unchanged from the global.
Trait Implementations§
Source§impl<'a> Clone for EffectivePlugin<'a>
impl<'a> Clone for EffectivePlugin<'a>
Source§fn clone(&self) -> EffectivePlugin<'a>
fn clone(&self) -> EffectivePlugin<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more