Struct hyper::server::Response
[−]
[src]
pub struct Response { /* fields omitted */ }
The Response sent to a client after receiving a Request in a Service.
The default StatusCode
for a Response
is 200 OK
.
Methods
impl Response
[src]
fn new() -> Response
Create a new Response.
fn headers(&self) -> &Headers
The headers of this response.
fn status(&self) -> &StatusCode
The status of this response.
fn version(&self) -> &HttpVersion
The HTTP version of this response.
fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the Headers.
fn set_status(&mut self, status: StatusCode)
Set the StatusCode
for this response.
fn set_body<T: Into<Body>>(&mut self, body: T)
Set the body.
fn with_status(self, status: StatusCode) -> Self
Set the status and move the Response.
Useful for the "builder-style" pattern.
fn with_header<H: Header>(self, header: H) -> Self
Set a header and move the Response.
Useful for the "builder-style" pattern.
fn with_headers(self, headers: Headers) -> Self
Set the headers and move the Response.
Useful for the "builder-style" pattern.
fn with_body<T: Into<Body>>(self, body: T) -> Self
Set the body and move the Response.
Useful for the "builder-style" pattern.