Struct actix_web::dev::Response [−][src]
pub struct Response<B> { /* fields omitted */ }
Expand description
An HTTP response.
Implementations
Constructs a new response with default body.
Constructs a new response builder.
Constructs a new response with status 400 Bad Request.
Constructs a new response with status 404 Not Found.
Constructs a new response with status 500 Internal Server Error.
Constructs a new response with given body.
Returns a reference to the head of this response.
Returns a mutable reference to the head of this response.
Returns the status code of this response.
Returns a mutable reference the status code of this response.
Returns a mutable reference to response headers.
Returns true if keep-alive is enabled.
Returns a reference to the extensions of this response.
Returns a mutable reference to the extensions of this response.
Returns split head and body.
Implementation Notes
Due to internal performance optimisations, the first element of the returned tuple is a
Response
as well but only contains the head of the response this was called on.
pub fn map_body<F, B2>(self, f: F) -> Response<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
pub fn map_body<F, B2>(self, f: F) -> Response<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
Returns new response with mapped body.
Trait Implementations
Get content encoding
Set content encoding Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
fn respond_to(self, _: &HttpRequest) -> HttpResponseⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
fn respond_to(self, _: &HttpRequest) -> HttpResponseⓘNotable traits for HttpResponse<AnyBody>impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Convert self to HttpResponse
.
Override a status code for a Responder. Read more
fn with_header<H>(self, header: H) -> CustomResponder<Self> where
Self: Sized,
H: IntoHeaderPair,
fn with_header<H>(self, header: H) -> CustomResponder<Self> where
Self: Sized,
H: IntoHeaderPair,
Insert header to the final response. Read more
Auto Trait Implementations
impl<B> !RefUnwindSafe for Response<B>
impl<B> !UnwindSafe for Response<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