Struct MapResult
pub struct MapResult<S, F> { /* private fields */ }
Service returned by the map_result combinator.
Implementations
impl<S, F> MapResult<S, F>
const fn new(inner: S, f: F) -> SelfCreates a new
MapResultservice.fn layer(f: F) -> MapResultLayer<F>Returns a new
Layerthat producesMapResultservices.This is a convenience function that simply calls
MapResultLayer::new.
Trait Implementations
impl<S, F> Debug for MapResult<S, F>
where
S: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S, F, Request, Response, Error> Service<Request> for MapResult<S, F>
where
S: Service<Request>,
Error: From<S::Error>,
F: FnOnce(Result<S::Response, S::Error>) -> Result<Response, Error> + Clone,
type Response = Response;type Error = Error;type Future = MapResultFuture<<S as Service<Request>>::Future, F>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, request: Request) -> Self::Future
impl<S: Clone, F: Clone> Clone for MapResult<S, F>
fn clone(&self) -> MapResult<S, F>
Auto Trait Implementations
impl<S, F> Freeze for MapResult<S, F>
where
S: Freeze,
F: Freeze,
impl<S, F> RefUnwindSafe for MapResult<S, F>
where
S: RefUnwindSafe,
F: RefUnwindSafe,
impl<S, F> Send for MapResult<S, F>
where
S: Send,
F: Send,
impl<S, F> Sync for MapResult<S, F>
where
S: Sync,
F: Sync,
impl<S, F> Unpin for MapResult<S, F>
where
S: Unpin,
F: Unpin,
impl<S, F> UnsafeUnpin for MapResult<S, F>
where
S: UnsafeUnpin,
F: UnsafeUnpin,
impl<S, F> UnwindSafe for MapResult<S, F>
where
S: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<C, Target> MakeConnection<Target> for MapResult<S, F>
where
C: Service<Target>,
<C as Service<Target>>::Response: AsyncRead + AsyncWrite,
type Connection = <C as Service<Target>>::Response;type Error = <C as Service<Target>>::Error;type Future = <C as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <C as MakeConnection<Target>>::Error>>fn make_connection(&mut self, target: Target) -> <C as MakeConnection<Target>>::Future
impl<M, S, Target, Request> MakeService<Target, Request> for MapResult<S, F>
where
M: Service<Target, Response = S>,
S: Service<Request>,
type Response = <S as Service<Request>>::Response;type Error = <S as Service<Request>>::Error;type Service = S;type MakeError = <M as Service<Target>>::Error;type Future = <M as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>fn make_service(&mut self, target: Target) -> <M as MakeService<Target, Request>>::Future
impl<T> Any for MapResult<S, F>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MapResult<S, F>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MapResult<S, F>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for MapResult<S, F>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for MapResult<S, F>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for MapResult<S, F>
impl<T> ToOwned for MapResult<S, F>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> WithSubscriber for MapResult<S, F>
impl<T, Request> ServiceExt<Request> for MapResult<S, F>
where
T: Service<Request> + ?Sized,
impl<T, U> Into<U> for MapResult<S, F>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MapResult<S, F>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for MapResult<S, F>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>