pub struct Layered<S, T> { /* private fields */ }
Expand description
A Service
created from a Handler
by applying a Tower middleware.
Created with Handler::layer
. See that method for more details.
Trait Implementations
sourceimpl<S, T, ReqBody, ResBody> Handler<T, ReqBody> for Layered<S, T> where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + 'static,
S::Error: IntoResponse,
S::Future: Send,
T: 'static,
ReqBody: Send + 'static,
ResBody: HttpBody<Data = Bytes> + Send + 'static,
ResBody::Error: Into<BoxError>,
impl<S, T, ReqBody, ResBody> Handler<T, ReqBody> for Layered<S, T> where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + 'static,
S::Error: IntoResponse,
S::Future: Send,
T: 'static,
ReqBody: Send + 'static,
ResBody: HttpBody<Data = Bytes> + Send + 'static,
ResBody::Error: Into<BoxError>,
type Future = LayeredFuture<S, ReqBody>
type Future = LayeredFuture<S, ReqBody>
The type of future calling this handler returns.
sourcefn layer<L>(self, layer: L) -> Layered<L::Service, T> where
L: Layer<IntoService<Self, T, B>>,
fn layer<L>(self, layer: L) -> Layered<L::Service, T> where
L: Layer<IntoService<Self, T, B>>,
Apply a tower::Layer
to the handler. Read more
sourcefn into_service(self) -> IntoService<Self, T, B>
fn into_service(self) -> IntoService<Self, T, B>
sourcefn into_make_service(self) -> IntoMakeService<IntoService<Self, T, B>>
fn into_make_service(self) -> IntoMakeService<IntoService<Self, T, B>>
Convert the handler into a MakeService
. Read more
sourcefn into_make_service_with_connect_info<C>(
self
) -> IntoMakeServiceWithConnectInfo<IntoService<Self, T, B>, C>
fn into_make_service_with_connect_info<C>(
self
) -> IntoMakeServiceWithConnectInfo<IntoService<Self, T, B>, C>
Convert the handler into a MakeService
which stores information
about the incoming connection. Read more
Auto Trait Implementations
impl<S, T> RefUnwindSafe for Layered<S, T> where
S: RefUnwindSafe,
impl<S, T> Send for Layered<S, T> where
S: Send,
impl<S, T> Sync for Layered<S, T> where
S: Sync,
impl<S, T> Unpin for Layered<S, T> where
S: Unpin,
impl<S, T> UnwindSafe for Layered<S, T> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more