Struct worker::Response [−][src]
pub struct Response { /* fields omitted */ }
Expand description
A Response representation for
working with or returning a response to a Request
.
Implementations
Create a Response
using B
as the body encoded as JSON. Sets the associated
Content-Type
header for the Response
as application/json
.
Create a Response
using the body encoded as HTML. Sets the associated Content-Type
header for the Response
as text/html
.
Create a Response
using unprocessed bytes provided. Sets the associated Content-Type
header for the Response
as application/octet-stream
.
Create a Response
using unprocessed text provided. Sets the associated Content-Type
header for the Response
as text/plain
.
A helper method to send an error message to a client. Will return Err
if the status code
provided is outside the valid HTTP error range of 400-599.
Set the HTTP Status code on this Response
.
Access this response’s body encoded as JSON.
Access this response’s body encoded as raw bytes.
Set this response’s Headers
.
Get a mutable reference to the Headers
on this response.