Struct actix_http::Response
source · [−]pub struct Response<B> { /* private fields */ }
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 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 request-local data/extensions container.
Returns a mutable reference to the request-local data/extensions container.
Returns split head and body.
Implementation Notes
Due to internal performance optimizations, 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,
Map the current body type to another using a closure, returning a new response.
Closure receives the response head and the current body type.
Map the current body to a type-erased BoxBody
.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Convert Response
to a ResponseBuilder
. Body get dropped.
Performs the conversion.
Performs the conversion.
Performs the conversion.