[−][src]Struct hyper::client::Response
An HTTP Response
Methods
impl<B> Response<B>[src]
pub fn new() -> Response<B>[src]
Constructs a default response
pub fn version(&self) -> HttpVersion[src]
Get the HTTP version of this response.
pub fn headers(&self) -> &Headers[src]
Get the headers from the response.
pub fn headers_mut(&mut self) -> &mut Headers[src]
Get a mutable reference to the headers.
pub fn status(&self) -> StatusCode[src]
Get the status from the server.
pub fn set_status(&mut self, status: StatusCode)[src]
Set the StatusCode for this response.
pub fn with_status(self, status: StatusCode) -> Self[src]
Set the status and move the Response.
Useful for the "builder-style" pattern.
pub fn with_header<H: Header>(self, header: H) -> Self[src]
Set a header and move the Response.
Useful for the "builder-style" pattern.
pub fn with_headers(self, headers: Headers) -> Self[src]
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]
Set the body.
pub fn with_body<T: Into<B>>(self, body: T) -> Self[src]
Set the body and move the Response.
Useful for the "builder-style" pattern.
pub fn body_ref(&self) -> Option<&B>[src]
Read the body.
impl Response<Body>[src]
Trait Implementations
impl Debug for Response[src]
impl<B> Default for Response<B>[src]
impl<B> Into<Message<__ProtoResponse, B>> for Response<B>[src]
Auto Trait Implementations
impl<B = Body> !RefUnwindSafe for Response<B>
impl<B> Send for Response<B> where
B: Send,
B: Send,
impl<B = Body> !Sync for Response<B>
impl<B> Unpin for Response<B> where
B: Unpin,
B: Unpin,
impl<B = Body> !UnwindSafe for Response<B>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,