pub trait Plugin: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn capabilities(&self) -> &'static [Capability];
// Provided methods
fn version(&self) -> &'static str { ... }
fn routes(&self) -> Routes { ... }
fn commands(&self) -> Vec<CommandEntry> { ... }
fn migrations(&self) -> Vec<Migration> { ... }
}Expand description
An installable Feature (plugin) distributed as a Cargo crate.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable plugin id used in diagnostics and optional route-name prefixes.
Sourcefn capabilities(&self) -> &'static [Capability]
fn capabilities(&self) -> &'static [Capability]
Capabilities this plugin claims. Must cover every non-empty contribution.
Provided Methods§
Sourcefn routes(&self) -> Routes
fn routes(&self) -> Routes
Routes contributed by this plugin. Prefer naming routes; path layout is the plugin author’s choice (no forced URL prefix).
Sourcefn commands(&self) -> Vec<CommandEntry>
fn commands(&self) -> Vec<CommandEntry>
Console commands contributed by this plugin.
Sourcefn migrations(&self) -> Vec<Migration>
fn migrations(&self) -> Vec<Migration>
Migrations contributed by this plugin.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".