Struct actix_web::BaseHttpResponse[][src]

pub struct BaseHttpResponse<B> { /* fields omitted */ }

An HTTP response.

Implementations

impl Response<Body>[src]

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Constructs a response

pub fn build(status: StatusCode) -> ResponseBuilder

Notable traits for ResponseBuilder

impl Future for ResponseBuilder type Output = Result<Response<Body>, Error>;
[src]

Create HTTP response builder with specific status.

pub fn ok() -> Response<Body>

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Creates a new response with status 200 OK.

pub fn bad_request() -> Response<Body>

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Creates a new response with status 400 Bad Request.

pub fn not_found() -> Response<Body>

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Creates a new response with status 404 Not Found.

pub fn internal_server_error() -> Response<Body>

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Creates a new response with status 500 Internal Server Error.

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Constructs an error response

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Convert response to response with body

impl<B> Response<B>[src]

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[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 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 of this response

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Set a body

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

Split response and body

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

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
[src]

Drop request’s body

pub fn map_body<F, B2>(self, f: F) -> Response<B2>

Notable traits for Response<B>

impl<B> Future for Response<B> where
    B: Unpin
type Output = Result<Response<B>, Error>;
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<B> BodyEncoding for Response<B>[src]

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

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

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

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

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

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

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

Convert Error to a Response instance

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

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

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

Convert Response to a ResponseBuilder. Body get dropped.

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

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

Convert Response to a Error

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

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

Helper converters

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

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

impl<B> Future for Response<B> where
    B: Unpin
[src]

type Output = Result<Response<B>, Error>

The type of value produced on completion.

impl Responder for Response<Body>[src]

Auto Trait Implementations

impl<B> !RefUnwindSafe for Response<B>

impl<B> !Send for Response<B>

impl<B> !Sync for Response<B>

impl<B> Unpin for Response<B> where
    B: Unpin

impl<B> !UnwindSafe for Response<B>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<T> Instrument for T[src]

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

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

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T> Same<T> for T

type Output = T

Should always be Self

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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

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<V, T> VZip<V> for T where
    V: MultiLane<T>,