Struct actix_web_lab::middleware::MapResBodyMiddleware
source · pub struct MapResBodyMiddleware<F> { /* private fields */ }
Expand description
Middleware transform for map_response_body
.
Trait Implementations§
source§impl<S, F, Fut, B, B2> Transform<S, ServiceRequest> for MapResBodyMiddleware<F>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
F: Fn(HttpRequest, B) -> Fut,
Fut: Future<Output = Result<B2, Error>>,
B2: MessageBody,
impl<S, F, Fut, B, B2> Transform<S, ServiceRequest> for MapResBodyMiddleware<F>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
F: Fn(HttpRequest, B) -> Fut,
Fut: Future<Output = Result<B2, Error>>,
B2: MessageBody,
source§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
source§type Transform = MapResBodyService<S, F, B>
type Transform = MapResBodyService<S, F, B>
The
TransformService
value created by this factorysource§type Future = Ready<Result<<MapResBodyMiddleware<F> as Transform<S, ServiceRequest>>::Transform, <MapResBodyMiddleware<F> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MapResBodyMiddleware<F> as Transform<S, ServiceRequest>>::Transform, <MapResBodyMiddleware<F> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl<F> Freeze for MapResBodyMiddleware<F>
impl<F> RefUnwindSafe for MapResBodyMiddleware<F>where
F: RefUnwindSafe,
impl<F> !Send for MapResBodyMiddleware<F>
impl<F> !Sync for MapResBodyMiddleware<F>
impl<F> Unpin for MapResBodyMiddleware<F>
impl<F> UnwindSafe for MapResBodyMiddleware<F>where
F: RefUnwindSafe,
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> 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<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more