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: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
T: 'static,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: IntoResponse,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, T, ReqBody, ResBody> Handler<T, ReqBody> for Layered<S, T> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
T: 'static,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: IntoResponse,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Future = LayeredFuture<S, ReqBody>
type Future = LayeredFuture<S, ReqBody>
The type of future calling this handler returns.
sourcefn call(
self,
req: Request<ReqBody>
) -> <Layered<S, T> as Handler<T, ReqBody>>::Future
fn call(
self,
req: Request<ReqBody>
) -> <Layered<S, T> as Handler<T, ReqBody>>::Future
Call the handler with the given request.
sourcefn layer<L>(
self,
layer: L
) -> Layered<<L as Layer<IntoService<Self, T, B>>>::Service, T> where
L: Layer<IntoService<Self, T, B>>,
fn layer<L>(
self,
layer: L
) -> Layered<<L as Layer<IntoService<Self, T, B>>>::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>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more