pub struct Response {
pub content: Vec<u8>,
/* private fields */
}Expand description
Contains the data of an http response
Fields§
§content: Vec<u8>Implementations§
Source§impl Response
impl Response
Sourcepub fn switching_protocols() -> Response
pub fn switching_protocols() -> Response
Creates an Switching Protocols response, with a 101 status code
Creates a Non-Authoritative Information response, with a 203 status code
Sourcepub fn no_content() -> Response
pub fn no_content() -> Response
Creates a No Content response, with a 204 status code
Sourcepub fn reset_content() -> Response
pub fn reset_content() -> Response
Creates a Reset Content response, with a 205 status code
Sourcepub fn partial_content() -> Response
pub fn partial_content() -> Response
Creates a Partial Content response, with a 206 status code
Sourcepub fn bad_request() -> Response
pub fn bad_request() -> Response
Creates a Bad Request response, with a 400 status code
Creates an Unauthorized response, with a 401 status code
Sourcepub fn payment_required() -> Response
pub fn payment_required() -> Response
Creates a Payment Required response, with a 402 status code
Sourcepub fn internal_server_error() -> Response
pub fn internal_server_error() -> Response
Creates an Internal Server Error response, with a 500 status code
Sourcepub fn not_implemented() -> Response
pub fn not_implemented() -> Response
Creates a Not Implemented response, with a 501 status code
Sourcepub fn bad_gateway() -> Response
pub fn bad_gateway() -> Response
Creates a Bad Gateway response, with a 502 status code
Creates a Service Unavailable response, with a 503 status code
Sourcepub fn new() -> Response
pub fn new() -> Response
Creates a new response, with defaut response status 200, and a text/html content type
Sourcepub fn header<A: Into<String>, B: Into<String>>(
self,
key: A,
value: B,
) -> Response
pub fn header<A: Into<String>, B: Into<String>>( self, key: A, value: B, ) -> Response
Inserts a header into the response
Sourcepub fn status_code(&self) -> u32
pub fn status_code(&self) -> u32
Returns the status code contained in the response