Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin {
    // Required method
    fn serve<N: Next + Send>(
        &self,
        cx: &mut Context<'_>,
        next: N,
    ) -> impl Future<Output = Outcome> + Send;

    // Provided method
    fn readiness(&self) -> Option<&dyn Readiness> { ... }
}
Expand description

A Plugin may await Next and inspect or modify its outcome and Response.

Required Methods§

Source

fn serve<N: Next + Send>( &self, cx: &mut Context<'_>, next: N, ) -> impl Future<Output = Outcome> + Send

Provided Methods§

Source

fn readiness(&self) -> Option<&dyn Readiness>

Return a readiness check when this Plugin participates in readiness.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§