Struct actix_web::BaseHttpResponse [−][src]
pub struct BaseHttpResponse<B> { /* fields omitted */ }Expand description
An HTTP response.
Implementations
Constructs a new response with default body.
pub fn build(status: StatusCode) -> ResponseBuilderⓘNotable traits for ResponseBuilder
impl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
pub fn build(status: StatusCode) -> ResponseBuilderⓘNotable traits for ResponseBuilder
impl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;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 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.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Convert Response to a ResponseBuilder. Body get dropped.
pub fn from(res: Response<B>) -> ResponseBuilderⓘNotable traits for ResponseBuilder
impl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
pub fn from(res: Response<B>) -> ResponseBuilderⓘNotable traits for ResponseBuilder
impl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;Performs the conversion.
Performs the conversion.
Performs the conversion.
fn respond_to(self, _: &HttpRequest) -> HttpResponseⓘNotable traits for HttpResponse<Body>
impl Future for HttpResponse<Body> type Output = Result<Response<Body>, Error>;
fn respond_to(self, _: &HttpRequest) -> HttpResponseⓘNotable traits for HttpResponse<Body>
impl Future for HttpResponse<Body> type Output = Result<Response<Body>, 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>