Skip to main content

EffectivePlugin

Struct EffectivePlugin 

Source
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>

Source

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 config replaces the global config entirely.
  • Override capabilities replaces global capabilities.
  • Override on_error replaces global on_error.
  • Everything else inherits unchanged from the global.

Trait Implementations§

Source§

impl<'a> Clone for EffectivePlugin<'a>

Source§

fn clone(&self) -> EffectivePlugin<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for EffectivePlugin<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for EffectivePlugin<'a>

§

impl<'a> RefUnwindSafe for EffectivePlugin<'a>

§

impl<'a> Send for EffectivePlugin<'a>

§

impl<'a> Sync for EffectivePlugin<'a>

§

impl<'a> Unpin for EffectivePlugin<'a>

§

impl<'a> UnsafeUnpin for EffectivePlugin<'a>

§

impl<'a> UnwindSafe for EffectivePlugin<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.