pub struct MapResponse<S, F> { /* private fields */ }
Expand description
Maps this service’s response value to a different value.
This method can be used to change the Response
type of the service
into a different type. It is similar to the Result::map
method. You can use this method to chain along a computation once the
service’s response has been resolved.
Implementations§
Source§impl<S, F> MapResponse<S, F>
impl<S, F> MapResponse<S, F>
Trait Implementations§
Source§impl<S, F> Clone for MapResponse<S, F>
impl<S, F> Clone for MapResponse<S, F>
Source§impl<S, F> Debug for MapResponse<S, F>where
S: Debug,
impl<S, F> Debug for MapResponse<S, F>where
S: Debug,
Auto Trait Implementations§
impl<S, F> Freeze for MapResponse<S, F>
impl<S, F> RefUnwindSafe for MapResponse<S, F>where
S: RefUnwindSafe,
F: RefUnwindSafe,
impl<S, F> Send for MapResponse<S, F>
impl<S, F> Sync for MapResponse<S, F>
impl<S, F> Unpin for MapResponse<S, F>
impl<S, F> UnwindSafe for MapResponse<S, F>where
S: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<S, StateIn, StateOut, RequestIn, RequestOut> RequestInspector<StateIn, RequestIn> for S
impl<S, StateIn, StateOut, RequestIn, RequestOut> RequestInspector<StateIn, RequestIn> for S
Source§type Error = <S as Service<StateIn, RequestIn>>::Error
type Error = <S as Service<StateIn, RequestIn>>::Error
The type of error returned by the service.
type RequestOut = RequestOut
type StateOut = StateOut
Source§fn inspect_request(
&self,
ctx: Context<StateIn>,
req: RequestIn,
) -> impl Future<Output = Result<(Context<<S as RequestInspector<StateIn, RequestIn>>::StateOut>, <S as RequestInspector<StateIn, RequestIn>>::RequestOut), <S as RequestInspector<StateIn, RequestIn>>::Error>> + Send
fn inspect_request( &self, ctx: Context<StateIn>, req: RequestIn, ) -> impl Future<Output = Result<(Context<<S as RequestInspector<StateIn, RequestIn>>::StateOut>, <S as RequestInspector<StateIn, RequestIn>>::RequestOut), <S as RequestInspector<StateIn, RequestIn>>::Error>> + Send
Inspect the request, modify it if needed or desired, and return it.