Trait rama::service::layer::Layer

source ·
pub trait Layer<S> {
    type Service;

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

A layer that produces a Layered service (middleware(inner service)).

Required Associated Types§

source

type Service

The service produced by the layer.

Required Methods§

source

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

Wrap the given service with the middleware, returning a new service.

Implementations on Foreign Types§

source§

impl<L, S> Layer<S> for Option<L>
where L: Layer<S>,

§

type Service = Either<<L as Layer<S>>::Service, S>

source§

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

Implementors§

source§

impl<A, B, C, D, E, F, G, H, I, S> Layer<S> for Either9<A, B, C, D, E, F, G, H, I>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>, E: Layer<S>, F: Layer<S>, G: Layer<S>, H: Layer<S>, I: Layer<S>,

§

type Service = Either9<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service, <E as Layer<S>>::Service, <F as Layer<S>>::Service, <G as Layer<S>>::Service, <H as Layer<S>>::Service, <I as Layer<S>>::Service>

source§

impl<A, B, C, D, E, F, G, H, S> Layer<S> for Either8<A, B, C, D, E, F, G, H>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>, E: Layer<S>, F: Layer<S>, G: Layer<S>, H: Layer<S>,

§

type Service = Either8<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service, <E as Layer<S>>::Service, <F as Layer<S>>::Service, <G as Layer<S>>::Service, <H as Layer<S>>::Service>

source§

impl<A, B, C, D, E, F, G, S> Layer<S> for Either7<A, B, C, D, E, F, G>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>, E: Layer<S>, F: Layer<S>, G: Layer<S>,

§

type Service = Either7<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service, <E as Layer<S>>::Service, <F as Layer<S>>::Service, <G as Layer<S>>::Service>

source§

impl<A, B, C, D, E, F, S> Layer<S> for Either6<A, B, C, D, E, F>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>, E: Layer<S>, F: Layer<S>,

§

type Service = Either6<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service, <E as Layer<S>>::Service, <F as Layer<S>>::Service>

source§

impl<A, B, C, D, E, S> Layer<S> for Either5<A, B, C, D, E>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>, E: Layer<S>,

§

type Service = Either5<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service, <E as Layer<S>>::Service>

source§

impl<A, B, C, D, S> Layer<S> for Either4<A, B, C, D>
where A: Layer<S>, B: Layer<S>, C: Layer<S>, D: Layer<S>,

§

type Service = Either4<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service, <D as Layer<S>>::Service>

source§

impl<A, B, C, S> Layer<S> for Either3<A, B, C>
where A: Layer<S>, B: Layer<S>, C: Layer<S>,

§

type Service = Either3<<A as Layer<S>>::Service, <B as Layer<S>>::Service, <C as Layer<S>>::Service>

source§

impl<A, B, S> Layer<S> for Either<A, B>
where A: Layer<S>, B: Layer<S>,

§

type Service = Either<<A as Layer<S>>::Service, <B as Layer<S>>::Service>

source§

impl<A, C, L, S> Layer<S> for ProxyAuthLayer<A, C, L>
where A: ProxyAuthority<C, L> + Clone, C: Credentials + Clone + Send + Sync + 'static,

§

type Service = ProxyAuthService<A, C, S, L>

source§

impl<F, S, Out> Layer<S> for LayerFn<F>
where F: FnOnce(S) -> Out + Clone,

§

type Service = Out

source§

impl<H: Clone, S> Layer<S> for TlsAcceptorLayer<H>

source§

impl<K, S> Layer<S> for HttpsConnectorLayer<K>

source§

impl<P, S> Layer<S> for RetryLayer<P>
where P: Clone,

§

type Service = Retry<P, S>

source§

impl<S> Layer<S> for AddAuthorizationLayer

source§

impl<S> Layer<S> for rama::http::layer::body_limit::BodyLimitLayer

source§

impl<S> Layer<S> for CorsLayer

§

type Service = Cors<S>

source§

impl<S> Layer<S> for DecompressionLayer

source§

impl<S> Layer<S> for RequestDecompressionLayer

source§

impl<S> Layer<S> for NormalizePathLayer

source§

impl<S> Layer<S> for RequestMetricsLayer

source§

impl<S> Layer<S> for PropagateHeaderLayer

source§

impl<S> Layer<S> for RemoveRequestHeaderLayer

source§

impl<S> Layer<S> for RemoveResponseHeaderLayer

source§

impl<S> Layer<S> for PropagateRequestIdLayer

source§

impl<S> Layer<S> for AddRequiredRequestHeadersLayer

source§

impl<S> Layer<S> for AddRequiredResponseHeadersLayer

source§

impl<S> Layer<S> for SetSensitiveHeadersLayer

source§

impl<S> Layer<S> for SetSensitiveRequestHeadersLayer

source§

impl<S> Layer<S> for SetSensitiveResponseHeadersLayer

source§

impl<S> Layer<S> for SetStatusLayer

source§

impl<S> Layer<S> for rama::http::layer::timeout::TimeoutLayer

§

type Service = Timeout<S>

source§

impl<S> Layer<S> for rama::net::stream::layer::http::BodyLimitLayer

source§

impl<S> Layer<S> for NetworkMetricsLayer

source§

impl<S> Layer<S> for BytesTrackerLayer

source§

impl<S> Layer<S> for HaProxyLayer

source§

impl<S> Layer<S> for UserAgentClassifierLayer

source§

impl<S> Layer<S> for rama::service::layer::http::BodyLimitLayer

source§

impl<S> Layer<S> for Identity

Decorates a Service, transforming either the request or the response.

§

type Service = S

source§

impl<S> Layer<S> for TraceErrLayer

source§

impl<S, D, P> Layer<S> for ProxyDBLayer<D, P>
where D: Clone, P: Clone,

§

type Service = ProxyDBService<S, D, P>

source§

impl<S, F> Layer<S> for MapRequestBodyLayer<F>
where F: Clone,

source§

impl<S, F> Layer<S> for MapResponseBodyLayer<F>
where F: Clone,

source§

impl<S, F> Layer<S> for AndThenLayer<F>
where F: Clone,

§

type Service = AndThen<S, F>

source§

impl<S, F> Layer<S> for ConsumeErrLayer<F>
where F: Clone,

§

type Service = ConsumeErr<S, F>

source§

impl<S, F> Layer<S> for MapErrLayer<F>
where F: Clone,

§

type Service = MapErr<S, F>

source§

impl<S, F> Layer<S> for MapRequestLayer<F>
where F: Clone,

§

type Service = MapRequest<S, F>

source§

impl<S, F> Layer<S> for MapResponseLayer<F>
where F: Clone,

§

type Service = MapResponse<S, F>

source§

impl<S, F> Layer<S> for MapResultLayer<F>
where F: Clone,

§

type Service = MapResult<S, F>

source§

impl<S, F> Layer<S> for ThenLayer<F>
where F: Clone,

§

type Service = Then<S, F>

source§

impl<S, F> Layer<S> for rama::service::layer::timeout::TimeoutLayer<F>
where F: MakeLayerError + Clone,

§

type Service = Timeout<S, F>

source§

impl<S, F: Clone> Layer<S> for ErrorHandlerLayer<F>

§

type Service = ErrorHandler<S, F>

source§

impl<S, F: Clone> Layer<S> for MapStateLayer<F>

§

type Service = MapState<S, F>

source§

impl<S, H, M> Layer<S> for HijackLayer<H, M>
where H: Clone, M: Clone,

§

type Service = HijackService<S, H, M>

source§

impl<S, Inner, Outer> Layer<S> for Stack<Inner, Outer>
where Inner: Layer<S>, Outer: Layer<Inner::Service>,

§

type Service = <Outer as Layer<<Inner as Layer<S>>::Service>>::Service

source§

impl<S, L> Layer<S> for ServiceBuilder<L>
where L: Layer<S>,

§

type Service = <L as Layer<S>>::Service

source§

impl<S, M> Layer<S> for SetRequestIdLayer<M>
where M: Clone + MakeRequestId,

§

type Service = SetRequestId<S, M>

source§

impl<S, M> Layer<S> for SetRequestHeaderLayer<M>
where M: Clone,

source§

impl<S, M> Layer<S> for SetResponseHeaderLayer<M>
where M: Clone,

source§

impl<S, M, MakeSpan, OnRequest, OnResponse, OnBodyChunk, OnEos, OnFailure> Layer<S> for TraceLayer<M, MakeSpan, OnRequest, OnResponse, OnBodyChunk, OnEos, OnFailure>
where M: Clone, MakeSpan: Clone, OnRequest: Clone, OnResponse: Clone, OnEos: Clone, OnBodyChunk: Clone, OnFailure: Clone,

§

type Service = Trace<S, M, MakeSpan, OnRequest, OnResponse, OnBodyChunk, OnEos, OnFailure>

source§

impl<S, P> Layer<S> for CompressionLayer<P>
where P: Predicate,

§

type Service = Compression<S, P>

source§

impl<S, P> Layer<S> for FollowRedirectLayer<P>
where S: Clone, P: Clone,

source§

impl<S, P: Clone> Layer<S> for HttpProxyConnectorLayer<P>

source§

impl<S, R> Layer<S> for DnsLayer<R>

§

type Service = DnsService<S, R>

source§

impl<S, State, O> Layer<S> for UpgradeLayer<State, O>

§

type Service = UpgradeService<S, State, O>

source§

impl<S, T> Layer<S> for AsyncRequireAuthorizationLayer<T>
where T: Clone,

source§

impl<S, T> Layer<S> for ValidateRequestHeaderLayer<T>
where T: Clone,

source§

impl<S, T> Layer<S> for AddExtensionLayer<T>
where T: Clone,

§

type Service = AddExtension<S, T>

source§

impl<S, W: Clone> Layer<S> for RequestWriterLayer<W>

source§

impl<S, W: Clone> Layer<S> for ResponseWriterLayer<W>

source§

impl<T, P> Layer<T> for LimitLayer<P>
where P: Clone,

§

type Service = Limit<T, P>

source§

impl<T, S> Layer<S> for CatchPanicLayer<T>
where T: Clone,

§

type Service = CatchPanic<S, T>

source§

impl<T, S> Layer<S> for HeaderConfigLayer<T>