roa_core

Trait MiddlewareExt

Source
pub trait MiddlewareExt<S>: Sized + for<'a> Middleware<'a, S> {
    // Provided methods
    fn chain<M>(self, next: M) -> Chain<Self, M>
       where M: for<'a> Middleware<'a, S> { ... }
    fn end<E>(self, next: E) -> Chain<Self, E>
       where E: for<'a> Endpoint<'a, S> { ... }
    fn shared(self) -> Shared<S>
       where S: 'static { ... }
}
Expand description

A set of method to chain middleware/endpoint to middleware or make middleware shared.

Provided Methods§

Source

fn chain<M>(self, next: M) -> Chain<Self, M>
where M: for<'a> Middleware<'a, S>,

Chain two middlewares.

Source

fn end<E>(self, next: E) -> Chain<Self, E>
where E: for<'a> Endpoint<'a, S>,

Chain an endpoint to a middleware.

Source

fn shared(self) -> Shared<S>
where S: 'static,

Make middleware shared.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S, T> MiddlewareExt<S> for T
where T: for<'a> Middleware<'a, S>,