[]Struct actix_web::web::HttpResponse

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

An HTTP Response

Methods

impl Response<Body>

pub fn Ok() -> ResponseBuilder

pub fn Created() -> ResponseBuilder

pub fn Accepted() -> ResponseBuilder

pub fn NonAuthoritativeInformation() -> ResponseBuilder

pub fn NoContent() -> ResponseBuilder

pub fn ResetContent() -> ResponseBuilder

pub fn PartialContent() -> ResponseBuilder

pub fn MultiStatus() -> ResponseBuilder

pub fn AlreadyReported() -> ResponseBuilder

pub fn MultipleChoices() -> ResponseBuilder

pub fn MovedPermanenty() -> ResponseBuilder

pub fn MovedPermanently() -> ResponseBuilder

pub fn Found() -> ResponseBuilder

pub fn SeeOther() -> ResponseBuilder

pub fn NotModified() -> ResponseBuilder

pub fn UseProxy() -> ResponseBuilder

pub fn TemporaryRedirect() -> ResponseBuilder

pub fn PermanentRedirect() -> ResponseBuilder

pub fn BadRequest() -> ResponseBuilder

pub fn NotFound() -> ResponseBuilder

pub fn Unauthorized() -> ResponseBuilder

pub fn PaymentRequired() -> ResponseBuilder

pub fn Forbidden() -> ResponseBuilder

pub fn MethodNotAllowed() -> ResponseBuilder

pub fn NotAcceptable() -> ResponseBuilder

pub fn ProxyAuthenticationRequired() -> ResponseBuilder

pub fn RequestTimeout() -> ResponseBuilder

pub fn Conflict() -> ResponseBuilder

pub fn Gone() -> ResponseBuilder

pub fn LengthRequired() -> ResponseBuilder

pub fn PreconditionFailed() -> ResponseBuilder

pub fn PreconditionRequired() -> ResponseBuilder

pub fn PayloadTooLarge() -> ResponseBuilder

pub fn UriTooLong() -> ResponseBuilder

pub fn UnsupportedMediaType() -> ResponseBuilder

pub fn RangeNotSatisfiable() -> ResponseBuilder

pub fn ExpectationFailed() -> ResponseBuilder

pub fn UnprocessableEntity() -> ResponseBuilder

pub fn TooManyRequests() -> ResponseBuilder

pub fn InternalServerError() -> ResponseBuilder

pub fn NotImplemented() -> ResponseBuilder

pub fn BadGateway() -> ResponseBuilder

pub fn ServiceUnavailable() -> ResponseBuilder

pub fn GatewayTimeout() -> ResponseBuilder

pub fn VersionNotSupported() -> ResponseBuilder

pub fn VariantAlsoNegotiates() -> ResponseBuilder

pub fn InsufficientStorage() -> ResponseBuilder

pub fn LoopDetected() -> ResponseBuilder

impl Response<Body>

pub fn build(status: StatusCode) -> ResponseBuilder

Create http response builder with specific status.

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

Create http response builder

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

Constructs a response

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

Constructs an error response

pub fn into_body<B>(self) -> Response<B>

Convert response to response with body

impl<B> Response<B>

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

Constructs a response with body

pub fn head(&self) -> &ResponseHead

Http message part of the response

pub fn head_mut(&mut self) -> &mut ResponseHead

Mutable reference to a http message part of the response

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

The source error for this response

pub fn status(&self) -> StatusCode

Get the response status code

pub fn status_mut(&mut self) -> &mut StatusCode

Set the StatusCode for this response

pub fn headers(&self) -> &HeaderMap

Get the headers from the response

pub fn headers_mut(&mut self) -> &mut HeaderMap

Get a mutable reference to the headers

pub fn cookies(&self) -> CookieIter

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

Connection upgrade status

pub fn keep_alive(&self) -> bool

Keep-alive status for this connection

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

Responses extensions

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

Mutable reference to a the response's extensions

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

Get body os this response

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

Set a body

pub fn into_parts(self) -> (Response<()>, ResponseBody<B>)

Split response and body

pub fn drop_body(self) -> Response<()>

Drop request's body

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

Set a body and return previous body value

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

Extract response body

Trait Implementations

impl<B> Debug for Response<B> where
    B: MessageBody

impl From<Response<Body>> for Error

Convert Response to a Error

impl<B> From<Response<B>> for ResponseBuilder

Convert Response to a ResponseBuilder. Body get dropped.

impl From<String> for Response<Body>

impl From<BytesMut> for Response<Body>

impl<'a> From<&'a String> for Response<Body>

impl From<Error> for Response<Body>

Convert Error to a Response instance

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

Helper converters

impl From<ResponseBuilder> for Response<Body>

impl From<&'static str> for Response<Body>

impl From<Bytes> for Response<Body>

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

impl IntoFuture for Response<Body>

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> 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.

fn with_status(self, status: StatusCode) -> CustomResponder<Self> where
    Self: Sized
[src]

Override a status code for a Responder. Read more

fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
    Self: Sized,
    HeaderName: HttpTryFrom<K>,
    V: IntoHeaderValue
[src]

Add header to the Responder's response. Read more

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> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,