Struct actix_web::HttpResponse

source ·
pub struct HttpResponse(_, _);
Expand description

An HTTP Response

Implementations

Create http response builder with specific status.

Create http response builder

Constructs a response

Constructs a response with body

Constructs an error response

Convert HttpResponse to a HttpResponseBuilder

The source error for this response

Get the HTTP version of this response

Get the headers from the response

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.

Get the response status code

Set the StatusCode for this response

Get custom reason for the response

Set the custom reason for the response

Set connection type

Connection upgrade status

Keep-alive status for this connection

is chunked encoding enabled

Content encoding

Set content encoding

Get body os this response

Set a body

Set a body and return previous body value

Size of response in bytes, excluding HTTP headers

Get write buffer capacity

Set write buffer capacity

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Convert Error to a HttpResponse instance

Converts to this type from the input type.
Converts to this type from the input type.

Helper converters

Converts to this type from the input type.
Converts to this type from the input type.
The associated item which can be returned.
The associated error which can be returned.
Convert itself to AsyncResult or Error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.