Struct MapResponse

pub struct MapResponse<S, F> { /* private fields */ }

Service returned by the map_response combinator.

Implementations

impl<S, F> MapResponse<S, F>

const fn new(inner: S, f: F) -> Self

Creates a new MapResponse service.

fn layer(f: F) -> MapResponseLayer<F>

Returns a new Layer that produces MapResponse services.

This is a convenience function that simply calls MapResponseLayer::new.

Trait Implementations

impl<S, F> Debug for MapResponse<S, F> where S: Debug,

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<S, F, Request, Response> Service<Request> for MapResponse<S, F> where S: Service<Request>, F: FnOnce(S::Response) -> Response + Clone,

type Response = Response;
type Error = <S as Service<Request>>::Error;
type Future = MapResponseFuture<<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 MapResponse<S, F>

fn clone(&self) -> MapResponse<S, F>

Auto Trait Implementations

impl<S, F> Freeze for MapResponse<S, F> where S: Freeze, F: Freeze,

impl<S, F> RefUnwindSafe for MapResponse<S, F> where S: RefUnwindSafe, F: RefUnwindSafe,

impl<S, F> Send for MapResponse<S, F> where S: Send, F: Send,

impl<S, F> Sync for MapResponse<S, F> where S: Sync, F: Sync,

impl<S, F> Unpin for MapResponse<S, F> where S: Unpin, F: Unpin,

impl<S, F> UnsafeUnpin for MapResponse<S, F> where S: UnsafeUnpin, F: UnsafeUnpin,

impl<S, F> UnwindSafe for MapResponse<S, F> where S: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<C, Target> MakeConnection<Target> for MapResponse<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 MapResponse<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 MapResponse<S, F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for MapResponse<S, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for MapResponse<S, F> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for MapResponse<S, F> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for MapResponse<S, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for MapResponse<S, F>

impl<T> ToOwned for MapResponse<S, F> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for MapResponse<S, F>

impl<T, Request> ServiceExt<Request> for MapResponse<S, F> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for MapResponse<S, F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for MapResponse<S, F> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for MapResponse<S, F> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>