pub trait Plugin {
// Required method
fn install(self, app: &mut App);
// Provided methods
fn id(&self) -> &'static str { ... }
fn requires(&self) -> &'static [&'static str] { ... }
fn meta(&self) -> PluginMeta { ... }
}Expand description
Single extension trait for the framework.
Prefer app.install(|app| { ... }) or app.install(Cors::new()) —
application code rarely needs to name this trait; plugin authors implement it.
Required Methods§
Provided Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable plugin identifier used for dependency checks and crate::App::has_plugin.
Prefer a short constant ("session") over the default std::any::type_name.
Sourcefn requires(&self) -> &'static [&'static str]
fn requires(&self) -> &'static [&'static str]
Required plugin ids that must be installed beforehand.
Missing deps are collected at install and reported on crate::App::build.
Sourcefn meta(&self) -> PluginMeta
fn meta(&self) -> PluginMeta
Display name, description, and declared PluginMeta::sdk version.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".