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>,
sourcefn call<'async_trait>(
self,
req: Request<ReqBody>
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>> where
Self: 'async_trait,
fn call<'async_trait>(
self,
req: Request<ReqBody>
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>> where
Self: 'async_trait,
Call the handler with the given request.
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, Target>(
self
) -> IntoMakeServiceWithConnectInfo<IntoService<Self, T, B>, C> where
C: Connected<Target>,
fn into_make_service_with_connect_info<C, Target>(
self
) -> IntoMakeServiceWithConnectInfo<IntoService<Self, T, B>, C> where
C: Connected<Target>,
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>
sourceimpl<T> PolicyExt for T where
T: ?Sized,
impl<T> PolicyExt for T where
T: ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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