Struct hyper::server::Response
[−]
[src]
pub struct Response<B = Body> { /* fields omitted */ }
An HTTP Response
Methods
impl<B> Response<B>
[src]
impl<B> Response<B>
pub fn new() -> Response<B>
[src]
pub fn new() -> Response<B>
Constructs a default response
pub fn version(&self) -> HttpVersion
[src]
pub fn version(&self) -> HttpVersion
Get the HTTP version of this response.
pub fn headers(&self) -> &Headers
[src]
pub fn headers(&self) -> &Headers
Get the headers from the response.
pub fn headers_mut(&mut self) -> &mut Headers
[src]
pub fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the headers.
pub fn status(&self) -> StatusCode
[src]
pub fn status(&self) -> StatusCode
Get the status from the server.
pub fn set_status(&mut self, status: StatusCode)
[src]
pub fn set_status(&mut self, status: StatusCode)
Set the StatusCode
for this response.
pub fn with_status(self, status: StatusCode) -> Self
[src]
pub fn with_status(self, status: StatusCode) -> Self
Set the status and move the Response.
Useful for the "builder-style" pattern.
pub fn with_header<H: Header>(self, header: H) -> Self
[src]
pub fn with_header<H: Header>(self, header: H) -> Self
Set a header and move the Response.
Useful for the "builder-style" pattern.
pub fn with_headers(self, headers: Headers) -> Self
[src]
pub fn with_headers(self, headers: Headers) -> Self
Set the headers and move the Response.
Useful for the "builder-style" pattern.
pub fn set_body<T: Into<B>>(&mut self, body: T)
[src]
pub fn set_body<T: Into<B>>(&mut self, body: T)
Set the body.
pub fn with_body<T: Into<B>>(self, body: T) -> Self
[src]
pub fn with_body<T: Into<B>>(self, body: T) -> Self
Set the body and move the Response.
Useful for the "builder-style" pattern.
pub fn body_ref(&self) -> Option<&B>
[src]
pub fn body_ref(&self) -> Option<&B>
Read the body.
impl Response<Body>
[src]
impl Response<Body>
Trait Implementations
impl<B> Default for Response<B>
[src]
impl<B> Default for Response<B>
impl Debug for Response
[src]
impl Debug for Response
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<B> Into<Message<__ProtoResponse, B>> for Response<B>
[src]
impl<B> Into<Message<__ProtoResponse, B>> for Response<B>