Struct actix_web::dev::ServiceResponse
source · [−]pub struct ServiceResponse<B = BoxBody> { /* private fields */ }
Expand description
A service level response wrapper.
Implementations
Create service response from the error
Create service response instance
Create service response for error
Create service response
Returns reference to original request.
pub fn response(&self) -> &HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
pub fn response(&self) -> &HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
Returns reference to response.
pub fn response_mut(&mut self) -> &mut HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
pub fn response_mut(&mut self) -> &mut HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
Returns mutable reference to response.
Returns response status code.
Returns mutable response’s headers.
Destructures ServiceResponse
into request and response components.
pub fn map_body<F, B2>(self, f: F) -> ServiceResponse<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
pub fn map_body<F, B2>(self, f: F) -> ServiceResponse<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
Map the current body type to another using a closure. Returns a new response.
Closure receives the response head and the current body type.
Trait Implementations
fn from(res: ServiceResponse<B>) -> HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
fn from(res: ServiceResponse<B>) -> HttpResponse<B>ⓘNotable traits for HttpResponse<BoxBody>impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
impl Future for HttpResponse<BoxBody> type Output = Result<Response<BoxBody>, Error>;
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<B = BoxBody> !RefUnwindSafe for ServiceResponse<B>
impl<B = BoxBody> !Send for ServiceResponse<B>
impl<B = BoxBody> !Sync for ServiceResponse<B>
impl<B> Unpin for ServiceResponse<B> where
B: Unpin,
impl<B = BoxBody> !UnwindSafe for ServiceResponse<B>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more