[−][src]Struct http_req::response::Response
Represents an HTTP response.
It contains Headers
and Status
parsed from response.
Methods
impl Response
[src]
pub fn from_head(head: &[u8]) -> Result<Response, Error>
[src]
Creates new Response
with head - status and headers - parsed from a slice of bytes
pub fn try_from<T: Write>(res: &[u8], writer: &mut T) -> Result<Response, Error>
[src]
Parses Response
from slice of bytes. Writes it's body to writer
.
pub fn status_code(&self) -> StatusCode
[src]
Returns status code of this Response
.
pub fn version(&self) -> &str
[src]
Returns HTTP version of this Response
.
pub fn reason(&self) -> &str
[src]
Returns reason of this Response
.
pub fn headers(&self) -> &Headers
[src]
Returns headers of this Response
.
pub fn content_len(&self) -> Result<usize, ParseErr>
[src]
Returns length of the content of this Response
as a Result
, according to information
included in headers. If there is no such an information, returns Ok(0)
.
Trait Implementations
impl PartialEq<Response> for Response
[src]
impl Clone for Response
[src]
fn clone(&self) -> Response
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Response
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,