pub trait NovaPlugin: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn on_init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn extend_router(&self, router: Router<()>) -> Router<()>;
// Provided method
fn on_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A plugin provides optional features to a Nova application.
Plugins should implement lifecycle hooks and may extend the application’s
router to register additional routes or middleware. Plugins are loaded and
initialized by NovaApp during startup.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".