Struct actix_http::Response [−][src]
pub struct Response<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 ResponseBuilderimpl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
pub fn build(status: StatusCode) -> ResponseBuilderⓘNotable traits for ResponseBuilderimpl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
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
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.
fn from(res: Response<B>) -> ResponseBuilderⓘNotable traits for ResponseBuilderimpl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
fn from(res: Response<B>) -> ResponseBuilderⓘNotable traits for ResponseBuilderimpl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
impl Future for ResponseBuilder type Output = Result<Response<AnyBody>, Error>;
Performs the conversion.
Performs the conversion.
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