Trait Layer

Source
pub trait Layer<S> {
    type Service;

    // Required method
    fn layer(self, inner: S) -> Self::Service;
}
Expand description

Decorates a Service

Required Associated Types§

Source

type Service

The wrapped service

Required Methods§

Source

fn layer(self, inner: S) -> Self::Service

Wrap the given service with the middleware, returning a new service that has been decorated with the middleware.

Implementors§

Source§

impl<S, F> Layer<S> for MapRequestLayer<F>
where F: Clone, S: Send + Sync + 'static,

Source§

impl<S, F> Layer<S> for MapResponseLayer<F>
where F: Clone, S: Send + Sync + 'static,