Struct unrest::Response
[−]
[src]
pub struct Response<B = Body> { /* fields omitted */ }
An HTTP Response
Methods
impl<B> Response<B>
[src]
fn new() -> Response<B>
Constructs a default response
fn version(&self) -> HttpVersion
Get the HTTP version of this response.
fn headers(&self) -> &Headers
Get the headers from the response.
fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the headers.
fn status(&self) -> StatusCode
Get the status from the server.
fn set_status(&mut self, status: StatusCode)
Set the StatusCode
for this response.
fn with_status(self, status: StatusCode) -> Response<B>
Set the status and move the Response.
Useful for the "builder-style" pattern.
fn with_header<H>(self, header: H) -> Response<B> where
H: Header,
H: Header,
Set a header and move the Response.
Useful for the "builder-style" pattern.
fn with_headers(self, headers: Headers) -> Response<B>
Set the headers and move the Response.
Useful for the "builder-style" pattern.
fn set_body<T>(&mut self, body: T) where
T: Into<B>,
T: Into<B>,
Set the body.
fn with_body<T>(self, body: T) -> Response<B> where
T: Into<B>,
T: Into<B>,
Set the body and move the Response.
Useful for the "builder-style" pattern.