Struct actix_web::HttpResponse
[−]
[src]
pub struct HttpResponse(_);
An HTTP Response
Methods
impl HttpResponse
[src]
fn build(status: StatusCode) -> HttpResponseBuilder
[src]
Create http response builder with specific status.
fn new(status: StatusCode, body: Body) -> HttpResponse
[src]
Constructs a response
fn from_error(error: Error) -> HttpResponse
[src]
Constructs a error response
fn error(&self) -> Option<&Error>
[src]
The source error
for this response
fn version(&self) -> Option<Version>
[src]
Get the HTTP version of this response.
fn headers(&self) -> &HeaderMap
[src]
Get the headers from the response.
fn headers_mut(&mut self) -> &mut HeaderMap
[src]
Get a mutable reference to the headers.
fn status(&self) -> StatusCode
[src]
Get the status from the server.
fn status_mut(&mut self) -> &mut StatusCode
[src]
Set the StatusCode
for this response.
fn reason(&self) -> &str
[src]
Get custom reason for the response.
fn set_reason(&mut self, reason: &'static str) -> &mut Self
[src]
Set the custom reason for the response.
fn set_connection_type(&mut self, conn: ConnectionType) -> &mut Self
[src]
Set connection type
fn upgrade(&self) -> bool
[src]
Connection upgrade status
fn keep_alive(&self) -> Option<bool>
[src]
Keep-alive status for this connection
fn chunked(&self) -> Option<bool>
[src]
is chunked encoding enabled
fn content_encoding(&self) -> ContentEncoding
[src]
Content encoding
fn set_content_encoding(&mut self, enc: ContentEncoding) -> &mut Self
[src]
Set content encoding
fn body(&self) -> &Body
[src]
Get body os this response
fn set_body<B: Into<Body>>(&mut self, body: B)
[src]
Set a body
fn replace_body<B: Into<Body>>(&mut self, body: B) -> Body
[src]
Set a body and return previous body value
fn response_size(&self) -> u64
[src]
Size of response in bytes, excluding HTTP headers
impl HttpResponse
[src]
fn Ok() -> HttpResponseBuilder
[src]
fn Created() -> HttpResponseBuilder
[src]
fn NoContent() -> HttpResponseBuilder
[src]
fn MultipleChoices() -> HttpResponseBuilder
[src]
fn MovedPermanenty() -> HttpResponseBuilder
[src]
fn Found() -> HttpResponseBuilder
[src]
fn SeeOther() -> HttpResponseBuilder
[src]
fn NotModified() -> HttpResponseBuilder
[src]
fn UseProxy() -> HttpResponseBuilder
[src]
fn TemporaryRedirect() -> HttpResponseBuilder
[src]
fn PermanentRedirect() -> HttpResponseBuilder
[src]
fn BadRequest() -> HttpResponseBuilder
[src]
fn NotFound() -> HttpResponseBuilder
[src]
[src]
fn PaymentRequired() -> HttpResponseBuilder
[src]
fn Forbidden() -> HttpResponseBuilder
[src]
fn MethodNotAllowed() -> HttpResponseBuilder
[src]
fn NotAcceptable() -> HttpResponseBuilder
[src]
fn ProxyAuthenticationRequired() -> HttpResponseBuilder
[src]
fn RequestTimeout() -> HttpResponseBuilder
[src]
fn Conflict() -> HttpResponseBuilder
[src]
fn Gone() -> HttpResponseBuilder
[src]
fn LengthRequired() -> HttpResponseBuilder
[src]
fn PreconditionFailed() -> HttpResponseBuilder
[src]
fn PayloadTooLarge() -> HttpResponseBuilder
[src]
fn UriTooLong() -> HttpResponseBuilder
[src]
fn ExpectationFailed() -> HttpResponseBuilder
[src]
fn InternalServerError() -> HttpResponseBuilder
[src]
Trait Implementations
impl Drop for HttpResponse
[src]
impl Debug for HttpResponse
[src]
impl<I: Into<HttpResponse>, E: Into<Error>> From<Result<I, E>> for HttpResponse
[src]
Helper converters
impl From<HttpResponseBuilder> for HttpResponse
[src]
fn from(builder: HttpResponseBuilder) -> Self
[src]
Performs the conversion.
impl From<&'static str> for HttpResponse
[src]
impl From<&'static [u8]> for HttpResponse
[src]
fn from(val: &'static [u8]) -> Self
[src]
Performs the conversion.
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 Responder for HttpResponse
[src]
type Item = Reply
The associated item which can be returned.
type Error = Error
The associated error which can be returned.
fn respond_to(self, _: HttpRequest) -> Result<Reply, Error>
[src]
Convert itself to Reply
or Error
.
impl From<Error> for HttpResponse
[src]
HttpResponse
for Error
impl From<StaticResponse> for HttpResponse
[src]
fn from(st: StaticResponse) -> Self
[src]
Performs the conversion.