[][src]Struct actix_web::HttpResponse

pub struct HttpResponse<B = Body> { /* fields omitted */ }

An HTTP Response

Methods

impl Response<Body>[src]

pub fn Ok() -> ResponseBuilder[src]

pub fn Created() -> ResponseBuilder[src]

pub fn Accepted() -> ResponseBuilder[src]

pub fn NonAuthoritativeInformation() -> ResponseBuilder[src]

pub fn NoContent() -> ResponseBuilder[src]

pub fn ResetContent() -> ResponseBuilder[src]

pub fn PartialContent() -> ResponseBuilder[src]

pub fn MultiStatus() -> ResponseBuilder[src]

pub fn AlreadyReported() -> ResponseBuilder[src]

pub fn MultipleChoices() -> ResponseBuilder[src]

pub fn MovedPermanenty() -> ResponseBuilder[src]

pub fn MovedPermanently() -> ResponseBuilder[src]

pub fn Found() -> ResponseBuilder[src]

pub fn SeeOther() -> ResponseBuilder[src]

pub fn NotModified() -> ResponseBuilder[src]

pub fn UseProxy() -> ResponseBuilder[src]

pub fn TemporaryRedirect() -> ResponseBuilder[src]

pub fn PermanentRedirect() -> ResponseBuilder[src]

pub fn BadRequest() -> ResponseBuilder[src]

pub fn NotFound() -> ResponseBuilder[src]

pub fn Unauthorized() -> ResponseBuilder[src]

pub fn PaymentRequired() -> ResponseBuilder[src]

pub fn Forbidden() -> ResponseBuilder[src]

pub fn MethodNotAllowed() -> ResponseBuilder[src]

pub fn NotAcceptable() -> ResponseBuilder[src]

pub fn ProxyAuthenticationRequired() -> ResponseBuilder[src]

pub fn RequestTimeout() -> ResponseBuilder[src]

pub fn Conflict() -> ResponseBuilder[src]

pub fn Gone() -> ResponseBuilder[src]

pub fn LengthRequired() -> ResponseBuilder[src]

pub fn PreconditionFailed() -> ResponseBuilder[src]

pub fn PreconditionRequired() -> ResponseBuilder[src]

pub fn PayloadTooLarge() -> ResponseBuilder[src]

pub fn UriTooLong() -> ResponseBuilder[src]

pub fn UnsupportedMediaType() -> ResponseBuilder[src]

pub fn RangeNotSatisfiable() -> ResponseBuilder[src]

pub fn ExpectationFailed() -> ResponseBuilder[src]

pub fn InternalServerError() -> ResponseBuilder[src]

pub fn NotImplemented() -> ResponseBuilder[src]

pub fn BadGateway() -> ResponseBuilder[src]

pub fn ServiceUnavailable() -> ResponseBuilder[src]

pub fn GatewayTimeout() -> ResponseBuilder[src]

pub fn VersionNotSupported() -> ResponseBuilder[src]

pub fn VariantAlsoNegotiates() -> ResponseBuilder[src]

pub fn InsufficientStorage() -> ResponseBuilder[src]

pub fn LoopDetected() -> ResponseBuilder[src]

impl Response<Body>[src]

pub fn build(status: StatusCode) -> ResponseBuilder[src]

Create http response builder with specific status.

pub fn build_from<T>(source: T) -> ResponseBuilder where
    T: Into<ResponseBuilder>, 
[src]

Create http response builder

pub fn new(status: StatusCode) -> Response<Body>[src]

Constructs a response

pub fn from_error(error: Error) -> Response<Body>[src]

Constructs an error response

pub fn into_body<B>(self) -> Response<B>[src]

Convert response to response with body

impl<B> Response<B>[src]

pub fn with_body(status: StatusCode, body: B) -> Response<B>[src]

Constructs a response with body

pub fn head(&self) -> &ResponseHead[src]

Http message part of the response

pub fn head_mut(&mut self) -> &mut ResponseHead[src]

Mutable reference to a http message part of the response

pub fn error(&self) -> Option<&Error>[src]

The source error for this response

pub fn status(&self) -> StatusCode[src]

Get the response status code

pub fn status_mut(&mut self) -> &mut StatusCode[src]

Set the StatusCode for this response

pub fn headers(&self) -> &HeaderMap[src]

Get the headers from the response

pub fn headers_mut(&mut self) -> &mut HeaderMap[src]

Get a mutable reference to the headers

pub fn cookies(&self) -> CookieIter[src]

Get an iterator for the cookies set by this response

Add a cookie to this response

Remove all cookies with the given name from this response. Returns the number of cookies removed.

pub fn upgrade(&self) -> bool[src]

Connection upgrade status

pub fn keep_alive(&self) -> bool[src]

Keep-alive status for this connection

pub fn extensions(&self) -> Ref<Extensions>[src]

Responses extensions

pub fn extensions_mut(&mut self) -> RefMut<Extensions>[src]

Mutable reference to a the response's extensions

pub fn body(&self) -> &ResponseBody<B>[src]

Get body os this response

pub fn set_body<B2>(self, body: B2) -> Response<B2>[src]

Set a body

pub fn drop_body(self) -> Response<()>[src]

Drop request's body

pub fn map_body<F, B2>(self, f: F) -> Response<B2> where
    F: FnOnce(&mut ResponseHead, ResponseBody<B>) -> ResponseBody<B2>, 
[src]

Set a body and return previous body value

pub fn take_body(&mut self) -> ResponseBody<B>[src]

Extract response body

Trait Implementations

impl IntoFuture for Response<Body>[src]

type Item = Response<Body>

The item that the future may resolve with.

type Error = Error

The error that the future may resolve with.

type Future = FutureResult<Response<Body>, Error>

The future that this type can be converted into.

impl<B> Debug for Response<B> where
    B: MessageBody
[src]

impl From<Response<Body>> for Error[src]

Convert Response to a Error

impl From<Bytes> for Response<Body>[src]

impl<B> From<Response<B>> for ResponseBuilder[src]

Convert Response to a ResponseBuilder. Body get dropped.

impl From<String> for Response<Body>[src]

impl<'a> From<&'a String> for Response<Body>[src]

impl From<Error> for Response<Body>[src]

Convert Error to a Response instance

impl<I, E> From<Result<I, E>> for Response<Body> where
    E: Into<Error>,
    I: Into<Response<Body>>, 
[src]

Helper converters

impl From<&'static str> for Response<Body>[src]

impl From<&'static [u8]> for Response<Body>[src]

impl From<ResponseBuilder> for Response<Body>[src]

impl From<BytesMut> for Response<Body>[src]

impl<B> BodyEncoding for Response<B>[src]

impl Responder for Response[src]

type Error = Error

The associated error which can be returned.

type Future = FutureResult<Response, Error>

The future response value.

impl<B> Into<Response<B>> for ServiceResponse<B>[src]

Auto Trait Implementations

impl<B = Body> !Send for Response<B>

impl<B = Body> !Sync for Response<B>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

impl<T> Erased for T