Trait nuclear::middleware::Middleware[][src]

pub trait Middleware: Send + Sync {
    fn handle<'t, 'n, 'a>(
        &'t self,
        req: Request,
        next: &'n dyn Handler
    ) -> BoxFuture<'a, Result<Response>>
    where
        't: 'a,
        'n: 'a,
        Self: 'a
; fn boxed(self) -> Box<dyn Middleware>

Notable traits for Box<F, A>

impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;

    where
        Self: Sized + 'static
, { ... } }

Required methods

fn handle<'t, 'n, 'a>(
    &'t self,
    req: Request,
    next: &'n dyn Handler
) -> BoxFuture<'a, Result<Response>> where
    't: 'a,
    'n: 'a,
    Self: 'a, 
[src]

Loading content...

Provided methods

fn boxed(self) -> Box<dyn Middleware>

Notable traits for Box<F, A>

impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
where
    Self: Sized + 'static, 
[src]

Loading content...

Implementations on Foreign Types

impl Middleware for Box<dyn Middleware>[src]

fn handle<'t, 'n, 'a>(
    &'t self,
    req: Request,
    next: &'n dyn Handler
) -> BoxFuture<'a, Result<Response>> where
    't: 'a,
    'n: 'a,
    Self: 'a, 
[src]

Loading content...

Implementors

impl<F> Middleware for MiddlewareFn<F> where
    F: for<'a> AsyncFn<'a, (Request, &'a dyn Handler), Output = Result<Response>>, 
[src]

fn handle<'t, 'n, 'a>(
    &'t self,
    req: Request,
    next: &'a dyn Handler
) -> BoxFuture<'a, Result<Response>> where
    't: 'a,
    'n: 'a,
    Self: 'a, 
[src]

impl<S, F> Middleware for ArcMiddlewareFn<S, F> where
    S: Send + Sync + 'static,
    F: for<'a> AsyncFn<'a, (Arc<S>, Request, &'a dyn Handler), Output = Result<Response>>, 
[src]

fn handle<'t, 'n, 'a>(
    &'t self,
    req: Request,
    next: &'a dyn Handler
) -> BoxFuture<'a, Result<Response>> where
    't: 'a,
    'n: 'a,
    Self: 'a, 
[src]

impl<S, F> Middleware for RefMiddlewareFn<S, F> where
    S: Send + Sync + 'static,
    F: for<'a> AsyncFn<'a, (&'a S, Request, &'a dyn Handler), Output = Result<Response>>, 
[src]

fn handle<'t, 'n, 'a>(
    &'t self,
    req: Request,
    next: &'a dyn Handler
) -> BoxFuture<'a, Result<Response>> where
    't: 'a,
    'n: 'a,
    Self: 'a, 
[src]

Loading content...