Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn register(self: Box<Self>, setup: &mut Setup<'_>);
}

Required Methods§

Source

fn name(&self) -> &'static str

Shown by rustlavel route:list and in boot logs.

Source

fn register(self: Box<Self>, setup: &mut Setup<'_>)

Add routes, middleware, and state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§