Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required method
    fn name(&self) -> &'static str;

    // Provided methods
    fn on_before_run<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context,
    ) -> Pin<Box<dyn Future<Output = Result<Context>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_after_run<'life0, 'async_trait>(
        &'life0 self,
        _ctx: Context,
    ) -> Pin<Box<dyn Future<Output = HookNoopResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn on_before_run<'life0, 'async_trait>( &'life0 self, ctx: Context, ) -> Pin<Box<dyn Future<Output = Result<Context>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn on_after_run<'life0, 'async_trait>( &'life0 self, _ctx: Context, ) -> Pin<Box<dyn Future<Output = HookNoopResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§