[][src]Struct actix_web::HttpResponse

pub struct HttpResponse(_, _);

An HTTP Response

Methods

impl HttpResponse[src]

pub fn Ok() -> HttpResponseBuilder[src]

pub fn Created() -> HttpResponseBuilder[src]

pub fn Accepted() -> HttpResponseBuilder[src]

pub fn NonAuthoritativeInformation() -> HttpResponseBuilder[src]

pub fn NoContent() -> HttpResponseBuilder[src]

pub fn ResetContent() -> HttpResponseBuilder[src]

pub fn PartialContent() -> HttpResponseBuilder[src]

pub fn MultiStatus() -> HttpResponseBuilder[src]

pub fn AlreadyReported() -> HttpResponseBuilder[src]

pub fn MultipleChoices() -> HttpResponseBuilder[src]

pub fn MovedPermanenty() -> HttpResponseBuilder[src]

pub fn MovedPermanently() -> HttpResponseBuilder[src]

pub fn Found() -> HttpResponseBuilder[src]

pub fn SeeOther() -> HttpResponseBuilder[src]

pub fn NotModified() -> HttpResponseBuilder[src]

pub fn UseProxy() -> HttpResponseBuilder[src]

pub fn TemporaryRedirect() -> HttpResponseBuilder[src]

pub fn PermanentRedirect() -> HttpResponseBuilder[src]

pub fn BadRequest() -> HttpResponseBuilder[src]

pub fn NotFound() -> HttpResponseBuilder[src]

pub fn Unauthorized() -> HttpResponseBuilder[src]

pub fn PaymentRequired() -> HttpResponseBuilder[src]

pub fn Forbidden() -> HttpResponseBuilder[src]

pub fn MethodNotAllowed() -> HttpResponseBuilder[src]

pub fn NotAcceptable() -> HttpResponseBuilder[src]

pub fn ProxyAuthenticationRequired() -> HttpResponseBuilder[src]

pub fn RequestTimeout() -> HttpResponseBuilder[src]

pub fn Conflict() -> HttpResponseBuilder[src]

pub fn Gone() -> HttpResponseBuilder[src]

pub fn LengthRequired() -> HttpResponseBuilder[src]

pub fn PreconditionFailed() -> HttpResponseBuilder[src]

pub fn PayloadTooLarge() -> HttpResponseBuilder[src]

pub fn UriTooLong() -> HttpResponseBuilder[src]

pub fn UnsupportedMediaType() -> HttpResponseBuilder[src]

pub fn RangeNotSatisfiable() -> HttpResponseBuilder[src]

pub fn ExpectationFailed() -> HttpResponseBuilder[src]

pub fn InternalServerError() -> HttpResponseBuilder[src]

pub fn NotImplemented() -> HttpResponseBuilder[src]

pub fn BadGateway() -> HttpResponseBuilder[src]

pub fn ServiceUnavailable() -> HttpResponseBuilder[src]

pub fn GatewayTimeout() -> HttpResponseBuilder[src]

pub fn VersionNotSupported() -> HttpResponseBuilder[src]

pub fn VariantAlsoNegotiates() -> HttpResponseBuilder[src]

pub fn InsufficientStorage() -> HttpResponseBuilder[src]

pub fn LoopDetected() -> HttpResponseBuilder[src]

impl HttpResponse[src]

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

Create a new HTTP response builder with specific status.

pub fn build_from<T: Into<HttpResponseBuilder>>(
    source: T
) -> HttpResponseBuilder
[src]

Create http response builder

pub fn new(status: StatusCode) -> HttpResponse[src]

Constructs a response

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

Constructs a response with body

pub fn from_error(error: Error) -> HttpResponse[src]

Constructs an error response

pub fn into_builder(self) -> HttpResponseBuilder[src]

Convert HttpResponse to a HttpResponseBuilder

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

The source error for this response

pub fn version(&self) -> Option<Version>[src]

Get the HTTP version of 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 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 reason(&self) -> &str[src]

Get custom reason for the response

pub fn set_reason(&mut self, reason: &'static str) -> &mut Self[src]

Set the custom reason for the response

pub fn set_connection_type(&mut self, conn: ConnectionType) -> &mut Self[src]

Set connection type

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

Connection upgrade status

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

Keep-alive status for this connection

pub fn chunked(&self) -> Option<bool>[src]

is chunked encoding enabled

pub fn content_encoding(&self) -> Option<ContentEncoding>[src]

Content encoding

pub fn set_content_encoding(&mut self, enc: ContentEncoding) -> &mut Self[src]

Set content encoding

pub fn body(&self) -> &Body[src]

Get body of this response

pub fn set_body<B: Into<Body>>(&mut self, body: B)[src]

Set a body

pub fn replace_body<B: Into<Body>>(&mut self, body: B) -> Body[src]

Set a body and return previous body value

pub fn response_size(&self) -> u64[src]

Size of response in bytes, excluding HTTP headers

pub fn write_buffer_capacity(&self) -> usize[src]

Get write buffer capacity

pub fn set_write_buffer_capacity(&mut self, cap: usize)[src]

Set write buffer capacity

Trait Implementations

impl Responder for HttpResponse[src]

type Item = AsyncResult<HttpResponse>

The associated item which can be returned.

type Error = Error

The associated error which can be returned.

impl<I: Into<HttpResponse>, E: Into<Error>> From<Result<I, E>> for HttpResponse[src]

Helper converters

impl From<HttpResponseBuilder> for HttpResponse[src]

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

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

impl From<String> for HttpResponse[src]

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

impl From<Bytes> for HttpResponse[src]

impl From<BytesMut> for HttpResponse[src]

impl From<Error> for HttpResponse[src]

Convert Error to a HttpResponse instance

impl Debug for HttpResponse[src]

Auto Trait Implementations

impl !Send for HttpResponse

impl !Sync for HttpResponse

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> Any for T where
    T: 'static + ?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> Erased for T