pub struct Apply<S, St, Req, F, In, Out, Err> { /* private fields */ }Expand description
Middleware service constructed by apply_fn or ApplyFactory.
Calls invoke the middleware function with an ApplyCtx. Binding and
shutdown are forwarded to the inner service, and readiness errors are
converted into the middleware’s error type.
Shares the enclosing readiness scope with its child unless the child has
its own readiness cache, for example through crate::ready().
Cloning clones both the inner service and middleware function. Whether those clones share state or readiness depends on the inner service’s clone behavior.
Trait Implementations§
Source§impl<S, St, Req, F, In, Out, Err> Debug for Apply<S, St, Req, F, In, Out, Err>where
S: Debug,
impl<S, St, Req, F, In, Out, Err> Debug for Apply<S, St, Req, F, In, Out, Err>where
S: Debug,
Source§impl<S, St, Req, F, In, Out, Err> Service<St, In> for Apply<S, St, Req, F, In, Out, Err>
impl<S, St, Req, F, In, Out, Err> Service<St, In> for Apply<S, St, Req, F, In, Out, Err>
Source§fn ready(
&self,
ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>,
) -> impl Future<Output = Result<(), Err>>
fn ready( &self, ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>, ) -> impl Future<Output = Result<(), Err>>
Waits until the service is ready to process a request. Read more
Source§fn call(
&self,
req: In,
ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>,
) -> impl Future<Output = Result<Out, Err>>
fn call( &self, req: In, ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>, ) -> impl Future<Output = Result<Out, Err>>
Processes a request and asynchronously returns the response. Read more
Source§fn shutdown(
&self,
ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>,
) -> impl Future<Output = ()>
fn shutdown( &self, ctx: Ctx<'_, Apply<S, St, Req, F, In, Out, Err>, St>, ) -> impl Future<Output = ()>
Shuts down the service. Read more
Source§fn map<F, Res>(self, f: F) -> ServiceChain<Map<F, Self, Res>, St, Req>
fn map<F, Res>(self, f: F) -> ServiceChain<Map<F, Self, Res>, St, Req>
Maps this service’s output to a different type, returning a new service. Read more
Source§fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<F, Self, E>, St, Req>
fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<F, Self, E>, St, Req>
Maps this service’s error to a different type, returning a new service. Read more
Auto Trait Implementations§
impl<S, St, Req, F, In, Out, Err> Freeze for Apply<S, St, Req, F, In, Out, Err>
impl<S, St, Req, F, In, Out, Err> RefUnwindSafe for Apply<S, St, Req, F, In, Out, Err>where
S: RefUnwindSafe,
F: RefUnwindSafe,
impl<S, St, Req, F, In, Out, Err> Send for Apply<S, St, Req, F, In, Out, Err>
impl<S, St, Req, F, In, Out, Err> Sync for Apply<S, St, Req, F, In, Out, Err>
impl<S, St, Req, F, In, Out, Err> Unpin for Apply<S, St, Req, F, In, Out, Err>
impl<S, St, Req, F, In, Out, Err> UnsafeUnpin for Apply<S, St, Req, F, In, Out, Err>where
S: UnsafeUnpin,
F: UnsafeUnpin,
impl<S, St, Req, F, In, Out, Err> UnwindSafe for Apply<S, St, Req, F, In, Out, Err>where
S: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, St, Req> IntoService<S, St, Req> for Swhere
S: Service<St, Req>,
impl<S, St, Req> IntoService<S, St, Req> for Swhere
S: Service<St, Req>,
Source§fn into_service(self) -> S
fn into_service(self) -> S
Converts this value into a service.