Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware: Send + Sync {
    // Required methods
    fn call<'async_trait>(
        self: Box<Self>,
        request: Request<Body>,
        next: Next,
    ) -> Pin<Box<dyn Future<Output = Response<Body>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn clone_box(&self) -> Box<dyn Middleware>;
}

Required Methods§

Source

fn call<'async_trait>( self: Box<Self>, request: Request<Body>, next: Next, ) -> Pin<Box<dyn Future<Output = Response<Body>> + Send + 'async_trait>>
where Self: 'async_trait,

Source

fn clone_box(&self) -> Box<dyn Middleware>

Trait Implementations§

Source§

impl From<BodyLimit> for Box<dyn Middleware>

Source§

fn from(value: BodyLimit) -> Box<dyn Middleware>

Converts to this type from the input type.
Source§

impl From<Cors> for Box<dyn Middleware>

Source§

fn from(value: Cors) -> Box<dyn Middleware>

Converts to this type from the input type.
Source§

impl From<HttpLog> for Box<dyn Middleware>

Source§

fn from(value: HttpLog) -> Box<dyn Middleware>

Converts to this type from the input type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§