Trait Middleware

Source
pub trait Middleware: Send + Sync {
    // Required methods
    fn call<'async_trait>(
        self: Box<Self>,
        request: Request,
        next: Next,
    ) -> Pin<Box<dyn Future<Output = Response> + 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, next: Next, ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
where Self: 'async_trait,

Source

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

Trait Implementations§

Source§

impl Clone for Box<dyn Middleware>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

Source§

impl<Func> Middleware for FuncMiddleware<Func>
where Func: MiddlewareFunc,