[−][src]Struct actix_web::HttpResponse
An HTTP Response
Methods
impl HttpResponse
[src]
impl HttpResponse
pub fn Ok() -> HttpResponseBuilder
[src]
pub fn Ok() -> HttpResponseBuilder
pub fn Created() -> HttpResponseBuilder
[src]
pub fn Created() -> HttpResponseBuilder
pub fn Accepted() -> HttpResponseBuilder
[src]
pub fn Accepted() -> HttpResponseBuilder
pub fn NonAuthoritativeInformation() -> HttpResponseBuilder
[src]
pub fn NonAuthoritativeInformation() -> HttpResponseBuilder
pub fn NoContent() -> HttpResponseBuilder
[src]
pub fn NoContent() -> HttpResponseBuilder
pub fn ResetContent() -> HttpResponseBuilder
[src]
pub fn ResetContent() -> HttpResponseBuilder
pub fn PartialContent() -> HttpResponseBuilder
[src]
pub fn PartialContent() -> HttpResponseBuilder
pub fn MultiStatus() -> HttpResponseBuilder
[src]
pub fn MultiStatus() -> HttpResponseBuilder
pub fn AlreadyReported() -> HttpResponseBuilder
[src]
pub fn AlreadyReported() -> HttpResponseBuilder
pub fn MultipleChoices() -> HttpResponseBuilder
[src]
pub fn MultipleChoices() -> HttpResponseBuilder
pub fn MovedPermanenty() -> HttpResponseBuilder
[src]
pub fn MovedPermanenty() -> HttpResponseBuilder
pub fn MovedPermanently() -> HttpResponseBuilder
[src]
pub fn MovedPermanently() -> HttpResponseBuilder
pub fn Found() -> HttpResponseBuilder
[src]
pub fn Found() -> HttpResponseBuilder
pub fn SeeOther() -> HttpResponseBuilder
[src]
pub fn SeeOther() -> HttpResponseBuilder
pub fn NotModified() -> HttpResponseBuilder
[src]
pub fn NotModified() -> HttpResponseBuilder
pub fn UseProxy() -> HttpResponseBuilder
[src]
pub fn UseProxy() -> HttpResponseBuilder
pub fn TemporaryRedirect() -> HttpResponseBuilder
[src]
pub fn TemporaryRedirect() -> HttpResponseBuilder
pub fn PermanentRedirect() -> HttpResponseBuilder
[src]
pub fn PermanentRedirect() -> HttpResponseBuilder
pub fn BadRequest() -> HttpResponseBuilder
[src]
pub fn BadRequest() -> HttpResponseBuilder
pub fn NotFound() -> HttpResponseBuilder
[src]
pub fn NotFound() -> HttpResponseBuilder
pub fn PaymentRequired() -> HttpResponseBuilder
[src]
pub fn PaymentRequired() -> HttpResponseBuilder
pub fn Forbidden() -> HttpResponseBuilder
[src]
pub fn Forbidden() -> HttpResponseBuilder
pub fn MethodNotAllowed() -> HttpResponseBuilder
[src]
pub fn MethodNotAllowed() -> HttpResponseBuilder
pub fn NotAcceptable() -> HttpResponseBuilder
[src]
pub fn NotAcceptable() -> HttpResponseBuilder
pub fn ProxyAuthenticationRequired() -> HttpResponseBuilder
[src]
pub fn ProxyAuthenticationRequired() -> HttpResponseBuilder
pub fn RequestTimeout() -> HttpResponseBuilder
[src]
pub fn RequestTimeout() -> HttpResponseBuilder
pub fn Conflict() -> HttpResponseBuilder
[src]
pub fn Conflict() -> HttpResponseBuilder
pub fn Gone() -> HttpResponseBuilder
[src]
pub fn Gone() -> HttpResponseBuilder
pub fn LengthRequired() -> HttpResponseBuilder
[src]
pub fn LengthRequired() -> HttpResponseBuilder
pub fn PreconditionFailed() -> HttpResponseBuilder
[src]
pub fn PreconditionFailed() -> HttpResponseBuilder
pub fn PayloadTooLarge() -> HttpResponseBuilder
[src]
pub fn PayloadTooLarge() -> HttpResponseBuilder
pub fn UriTooLong() -> HttpResponseBuilder
[src]
pub fn UriTooLong() -> HttpResponseBuilder
pub fn UnsupportedMediaType() -> HttpResponseBuilder
[src]
pub fn UnsupportedMediaType() -> HttpResponseBuilder
pub fn RangeNotSatisfiable() -> HttpResponseBuilder
[src]
pub fn RangeNotSatisfiable() -> HttpResponseBuilder
pub fn ExpectationFailed() -> HttpResponseBuilder
[src]
pub fn ExpectationFailed() -> HttpResponseBuilder
pub fn InternalServerError() -> HttpResponseBuilder
[src]
pub fn InternalServerError() -> HttpResponseBuilder
pub fn NotImplemented() -> HttpResponseBuilder
[src]
pub fn NotImplemented() -> HttpResponseBuilder
pub fn BadGateway() -> HttpResponseBuilder
[src]
pub fn BadGateway() -> HttpResponseBuilder
pub fn GatewayTimeout() -> HttpResponseBuilder
[src]
pub fn GatewayTimeout() -> HttpResponseBuilder
pub fn VersionNotSupported() -> HttpResponseBuilder
[src]
pub fn VersionNotSupported() -> HttpResponseBuilder
pub fn VariantAlsoNegotiates() -> HttpResponseBuilder
[src]
pub fn VariantAlsoNegotiates() -> HttpResponseBuilder
pub fn InsufficientStorage() -> HttpResponseBuilder
[src]
pub fn InsufficientStorage() -> HttpResponseBuilder
pub fn LoopDetected() -> HttpResponseBuilder
[src]
pub fn LoopDetected() -> HttpResponseBuilder
impl HttpResponse
[src]
impl HttpResponse
pub fn build(status: StatusCode) -> HttpResponseBuilder
[src]
pub fn build(status: StatusCode) -> HttpResponseBuilder
Create http response builder with specific status.
pub fn build_from<T: Into<HttpResponseBuilder>>(
source: T
) -> HttpResponseBuilder
[src]
pub fn build_from<T: Into<HttpResponseBuilder>>(
source: T
) -> HttpResponseBuilder
Create http response builder
pub fn new(status: StatusCode) -> HttpResponse
[src]
pub fn new(status: StatusCode) -> HttpResponse
Constructs a response
pub fn with_body<B: Into<Body>>(status: StatusCode, body: B) -> HttpResponse
[src]
pub fn with_body<B: Into<Body>>(status: StatusCode, body: B) -> HttpResponse
Constructs a response with body
pub fn from_error(error: Error) -> HttpResponse
[src]
pub fn from_error(error: Error) -> HttpResponse
Constructs an error response
pub fn into_builder(self) -> HttpResponseBuilder
[src]
pub fn into_builder(self) -> HttpResponseBuilder
Convert HttpResponse
to a HttpResponseBuilder
pub fn error(&self) -> Option<&Error>
[src]
pub fn error(&self) -> Option<&Error>
The source error
for this response
pub fn version(&self) -> Option<Version>
[src]
pub fn version(&self) -> Option<Version>
Get the HTTP version of this response
pub fn headers(&self) -> &HeaderMap
[src]
pub fn headers(&self) -> &HeaderMap
Get the headers from the response
pub fn headers_mut(&mut self) -> &mut HeaderMap
[src]
pub fn headers_mut(&mut self) -> &mut HeaderMap
Get a mutable reference to the headers
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]
pub fn status(&self) -> StatusCode
Get the response status code
pub fn status_mut(&mut self) -> &mut StatusCode
[src]
pub fn status_mut(&mut self) -> &mut StatusCode
Set the StatusCode
for this response
pub fn reason(&self) -> &str
[src]
pub fn reason(&self) -> &str
Get custom reason for the response
pub fn set_reason(&mut self, reason: &'static str) -> &mut Self
[src]
pub fn set_reason(&mut self, reason: &'static str) -> &mut Self
Set the custom reason for the response
pub fn set_connection_type(&mut self, conn: ConnectionType) -> &mut Self
[src]
pub fn set_connection_type(&mut self, conn: ConnectionType) -> &mut Self
Set connection type
pub fn upgrade(&self) -> bool
[src]
pub fn upgrade(&self) -> bool
Connection upgrade status
pub fn keep_alive(&self) -> Option<bool>
[src]
pub fn keep_alive(&self) -> Option<bool>
Keep-alive status for this connection
pub fn chunked(&self) -> Option<bool>
[src]
pub fn chunked(&self) -> Option<bool>
is chunked encoding enabled
pub fn content_encoding(&self) -> Option<ContentEncoding>
[src]
pub fn content_encoding(&self) -> Option<ContentEncoding>
Content encoding
pub fn set_content_encoding(&mut self, enc: ContentEncoding) -> &mut Self
[src]
pub fn set_content_encoding(&mut self, enc: ContentEncoding) -> &mut Self
Set content encoding
pub fn body(&self) -> &Body
[src]
pub fn body(&self) -> &Body
Get body os this response
pub fn set_body<B: Into<Body>>(&mut self, body: B)
[src]
pub fn set_body<B: Into<Body>>(&mut self, body: B)
Set a body
pub fn replace_body<B: Into<Body>>(&mut self, body: B) -> Body
[src]
pub fn replace_body<B: Into<Body>>(&mut self, body: B) -> Body
Set a body and return previous body value
pub fn response_size(&self) -> u64
[src]
pub fn response_size(&self) -> u64
Size of response in bytes, excluding HTTP headers
pub fn write_buffer_capacity(&self) -> usize
[src]
pub fn write_buffer_capacity(&self) -> usize
Get write buffer capacity
pub fn set_write_buffer_capacity(&mut self, cap: usize)
[src]
pub fn set_write_buffer_capacity(&mut self, cap: usize)
Set write buffer capacity
Trait Implementations
impl Responder for HttpResponse
[src]
impl Responder for HttpResponse
type Item = AsyncResult<HttpResponse>
The associated item which can be returned.
type Error = Error
The associated error which can be returned.
fn respond_to<S>(
self,
_: &HttpRequest<S>
) -> Result<AsyncResult<HttpResponse>, Error>
[src]
fn respond_to<S>(
self,
_: &HttpRequest<S>
) -> Result<AsyncResult<HttpResponse>, Error>
Convert itself to AsyncResult
or Error
.
impl<I: Into<HttpResponse>, E: Into<Error>> From<Result<I, E>> for HttpResponse
[src]
impl<I: Into<HttpResponse>, E: Into<Error>> From<Result<I, E>> for HttpResponse
Helper converters
impl From<HttpResponseBuilder> for HttpResponse
[src]
impl From<HttpResponseBuilder> for HttpResponse
fn from(builder: HttpResponseBuilder) -> Self
[src]
fn from(builder: HttpResponseBuilder) -> Self
Performs the conversion.
impl From<&'static str> for HttpResponse
[src]
impl From<&'static str> for HttpResponse
impl From<&'static [u8]> for HttpResponse
[src]
impl From<&'static [u8]> for HttpResponse
fn from(val: &'static [u8]) -> Self
[src]
fn from(val: &'static [u8]) -> Self
Performs the conversion.
impl From<String> for HttpResponse
[src]
impl From<String> for HttpResponse
impl<'a> From<&'a String> for HttpResponse
[src]
impl<'a> From<&'a String> for HttpResponse
impl From<Bytes> for HttpResponse
[src]
impl From<Bytes> for HttpResponse
impl From<BytesMut> for HttpResponse
[src]
impl From<BytesMut> for HttpResponse
impl From<Error> for HttpResponse
[src]
impl From<Error> for HttpResponse
Convert Error
to a HttpResponse
instance
impl Debug for HttpResponse
[src]
impl Debug for HttpResponse
Auto Trait Implementations
impl !Send for HttpResponse
impl !Send for HttpResponse
impl !Sync for HttpResponse
impl !Sync for HttpResponse
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Erased for T
impl<T> Erased for T