[−][src]Struct actix_web::web::HttpResponse
An HTTP Response
Methods
impl Response<Body>
[src]
ⓘImportant traits for ResponseBuilderpub fn Ok() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Created() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Accepted() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NonAuthoritativeInformation() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NoContent() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn ResetContent() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PartialContent() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn MultiStatus() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn AlreadyReported() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn MultipleChoices() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn MovedPermanently() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Found() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn SeeOther() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NotModified() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn UseProxy() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn TemporaryRedirect() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PermanentRedirect() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn BadRequest() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NotFound() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Unauthorized() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PaymentRequired() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Forbidden() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn MethodNotAllowed() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NotAcceptable() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn ProxyAuthenticationRequired() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn RequestTimeout() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Conflict() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn Gone() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn LengthRequired() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PreconditionFailed() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PreconditionRequired() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn PayloadTooLarge() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn UriTooLong() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn UnsupportedMediaType() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn RangeNotSatisfiable() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn ExpectationFailed() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn UnprocessableEntity() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn TooManyRequests() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn InternalServerError() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn NotImplemented() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn BadGateway() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn ServiceUnavailable() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn GatewayTimeout() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn VersionNotSupported() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn VariantAlsoNegotiates() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn InsufficientStorage() -> ResponseBuilder
[src]
ⓘImportant traits for ResponseBuilderpub fn LoopDetected() -> ResponseBuilder
[src]
impl Response<Body>
[src]
ⓘImportant traits for ResponseBuilderpub fn build(status: StatusCode) -> ResponseBuilder
[src]
Create http response builder with specific status.
ⓘImportant traits for ResponseBuilderpub fn build_from<T>(source: T) -> ResponseBuilder where
T: Into<ResponseBuilder>,
[src]
T: Into<ResponseBuilder>,
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
pub fn add_cookie(&mut self, cookie: &Cookie) -> Result<(), Error>
[src]
Add a cookie to this response
pub fn del_cookie(&mut self, name: &str) -> usize
[src]
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 of this response
pub fn set_body<B2>(self, body: B2) -> Response<B2>
[src]
Set a body
pub fn into_parts(self) -> (Response<()>, ResponseBody<B>)
[src]
Split response and 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]
F: FnOnce(&mut ResponseHead, ResponseBody<B>) -> ResponseBody<B2>,
Set a body and return previous body value
pub fn take_body(&mut self) -> ResponseBody<B>
[src]
Extract response body
Trait Implementations
impl<B> Debug for Response<B> where
B: MessageBody,
[src]
B: MessageBody,
impl Future for Response<Body>
[src]
type Output = Result<Response<Body>, Error>
The type of value produced on completion.
fn poll(
self: Pin<&mut Response<Body>>,
&mut Context
) -> Poll<<Response<Body> as Future>::Output>
[src]
self: Pin<&mut Response<Body>>,
&mut Context
) -> Poll<<Response<Body> as Future>::Output>
impl<B> From<Response<B>> for ResponseBuilder
[src]
Convert Response
to a ResponseBuilder
. Body get dropped.
ⓘImportant traits for ResponseBuilderfn from(res: Response<B>) -> ResponseBuilder
[src]
impl From<BytesMut> for Response<Body>
[src]
impl From<Response<Body>> for Error
[src]
Convert Response to a Error
impl<I, E> From<Result<I, E>> for Response<Body> where
E: Into<Error>,
I: Into<Response<Body>>,
[src]
E: Into<Error>,
I: Into<Response<Body>>,
Helper converters
impl From<Bytes> for Response<Body>
[src]
impl From<String> for Response<Body>
[src]
impl<'a> From<&'a String> for Response<Body>
[src]
impl From<&'static str> for Response<Body>
[src]
impl From<Error> for Response<Body>
[src]
Convert Error
to a Response
instance
impl From<ResponseBuilder> for Response<Body>
[src]
impl From<&'static [u8]> for Response<Body>
[src]
impl<B> BodyEncoding for Response<B>
[src]
fn encoding(&mut self, encoding: ContentEncoding) -> &mut Self
[src]
impl Responder for Response
[src]
type Error = Error
The associated error which can be returned.
type Future = Ready<Result<Response, Error>>
The future response value.
fn respond_to(self, _: &HttpRequest) -> Self::Future
[src]
fn with_status(self, status: StatusCode) -> CustomResponder<Self> where
Self: Sized,
[src]
Self: Sized,
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
Self: Sized,
HeaderName: HttpTryFrom<K>,
V: IntoHeaderValue,
[src]
Self: Sized,
HeaderName: HttpTryFrom<K>,
V: IntoHeaderValue,
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>
impl<B> Unpin for Response<B>
impl<B = Body> !UnwindSafe for Response<B>
impl<B = Body> !RefUnwindSafe for Response<B>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> FutureExt for T where
T: Future + ?Sized,
[src]
T: Future + ?Sized,
fn map<U, F>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U,
[src]
F: FnOnce(Self::Output) -> U,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
[src]
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
fn left_future<B>(self) -> Either<Self, B> where
B: Future<Output = Self::Output>,
[src]
B: Future<Output = Self::Output>,
fn right_future<A>(self) -> Either<A, Self> where
A: Future<Output = Self::Output>,
[src]
A: Future<Output = Self::Output>,
fn into_stream(self) -> IntoStream<Self>
[src]
fn flatten(self) -> Flatten<Self> where
Self::Output: Future,
[src]
Self::Output: Future,
fn flatten_stream(self) -> FlattenStream<Self> where
Self::Output: Stream,
[src]
Self::Output: Stream,
fn fuse(self) -> Fuse<Self>
[src]
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output),
[src]
F: FnOnce(&Self::Output),
fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[src]
Self: UnwindSafe,
fn shared(self) -> Shared<Self> where
Self::Output: Clone,
[src]
Self::Output: Clone,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
[src]
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send>> where
Self: Send + 'a,
[src]
Self: Send + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>> where
Self: 'a,
[src]
Self: 'a,
fn unit_error(self) -> UnitError<Self>
[src]
fn never_error(self) -> NeverError<Self>
[src]
fn poll_unpin(&mut self, cx: &mut Context) -> Poll<Self::Output> where
Self: Unpin,
[src]
Self: Unpin,
fn now_or_never(self) -> Option<Self::Output>
[src]
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src]
F: Future<Output = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
fn try_poll(self: Pin<&mut F>, cx: &mut Context) -> Poll<<F as Future>::Output>
[src]
impl<Fut> TryFutureExt for Fut where
Fut: TryFuture + ?Sized,
[src]
Fut: TryFuture + ?Sized,
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok> where
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
[src]
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> where
F: FnOnce(Self::Ok) -> T,
[src]
F: FnOnce(Self::Ok) -> T,
fn map_err<E, F>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
[src]
F: FnOnce(Self::Error) -> E,
fn err_into<E>(self) -> ErrInto<Self, E> where
Self::Error: Into<E>,
[src]
Self::Error: Into<E>,
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> where
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
[src]
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> where
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
[src]
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> where
F: FnOnce(&Self::Ok),
[src]
F: FnOnce(&Self::Ok),
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> where
F: FnOnce(&Self::Error),
[src]
F: FnOnce(&Self::Error),
fn try_flatten_stream(self) -> TryFlattenStream<Self> where
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
[src]
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> where
F: FnOnce(Self::Error) -> Self::Ok,
[src]
F: FnOnce(Self::Error) -> Self::Ok,
fn into_future(self) -> IntoFuture<Self>
[src]
fn try_poll_unpin(
&mut self,
cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
[src]
&mut self,
cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src]
F: Future<Output = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
fn try_poll(self: Pin<&mut F>, cx: &mut Context) -> Poll<<F as Future>::Output>
[src]
impl<T> FutureExt for T where
T: Future + ?Sized,
[src]
T: Future + ?Sized,
fn map<U, F>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U,
[src]
F: FnOnce(Self::Output) -> U,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
[src]
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
fn left_future<B>(self) -> Either<Self, B> where
B: Future<Output = Self::Output>,
[src]
B: Future<Output = Self::Output>,
fn right_future<A>(self) -> Either<A, Self> where
A: Future<Output = Self::Output>,
[src]
A: Future<Output = Self::Output>,
fn into_stream(self) -> IntoStream<Self>
[src]
fn flatten(self) -> Flatten<Self> where
Self::Output: Future,
[src]
Self::Output: Future,
fn flatten_stream(self) -> FlattenStream<Self> where
Self::Output: Stream,
[src]
Self::Output: Stream,
fn fuse(self) -> Fuse<Self>
[src]
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output),
[src]
F: FnOnce(&Self::Output),
fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[src]
Self: UnwindSafe,
fn shared(self) -> Shared<Self> where
Self::Output: Clone,
[src]
Self::Output: Clone,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
[src]
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send>> where
Self: Send + 'a,
[src]
Self: Send + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>> where
Self: 'a,
[src]
Self: 'a,
fn unit_error(self) -> UnitError<Self>
[src]
fn never_error(self) -> NeverError<Self>
[src]
fn poll_unpin(&mut self, cx: &mut Context) -> Poll<Self::Output> where
Self: Unpin,
[src]
Self: Unpin,
fn now_or_never(self) -> Option<Self::Output>
[src]
impl<Fut> TryFutureExt for Fut where
Fut: TryFuture + ?Sized,
[src]
Fut: TryFuture + ?Sized,
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok> where
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
[src]
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> where
F: FnOnce(Self::Ok) -> T,
[src]
F: FnOnce(Self::Ok) -> T,
fn map_err<E, F>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
[src]
F: FnOnce(Self::Error) -> E,
fn err_into<E>(self) -> ErrInto<Self, E> where
Self::Error: Into<E>,
[src]
Self::Error: Into<E>,
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> where
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
[src]
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> where
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
[src]
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> where
F: FnOnce(&Self::Ok),
[src]
F: FnOnce(&Self::Ok),
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> where
F: FnOnce(&Self::Error),
[src]
F: FnOnce(&Self::Error),
fn try_flatten_stream(self) -> TryFlattenStream<Self> where
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
[src]
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> where
F: FnOnce(Self::Error) -> Self::Ok,
[src]
F: FnOnce(Self::Error) -> Self::Ok,
fn into_future(self) -> IntoFuture<Self>
[src]
fn try_poll_unpin(
&mut self,
cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
[src]
&mut self,
cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
impl<T> FutureExt for T where
T: Future + ?Sized,
[src]
T: Future + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,