Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> String;
    fn apply(self, ctx: &mut Ctx) -> Result<Disposer, PluginError>;

    // Provided method
    fn dependencies(&self) -> Vec<String> { ... }
}
Expand description

A statically-registered capability unit (ADR-004). apply installs services and event handlers into Ctx and returns the Disposer that unwinds them; dependencies are declared by plugin name and resolved by topological activation (the static equivalent of Cordis inject).

Required Methods§

Source

fn name(&self) -> String

Unique plugin name (the dependency-graph node).

Source

fn apply(self, ctx: &mut Ctx) -> Result<Disposer, PluginError>

Provided Methods§

Source

fn dependencies(&self) -> Vec<String>

Names of plugins that must be activated before this one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§