Struct ntex::http::client::ClientResponse[][src]

pub struct ClientResponse { /* fields omitted */ }

Client Response

Implementations

impl ClientResponse[src]

pub fn version(&self) -> Version[src]

Read the Request Version.

pub fn status(&self) -> StatusCode[src]

Get the status from the server.

pub fn header<N: AsName>(&self, name: N) -> Option<&HeaderValue>[src]

Returns a reference to the header value.

pub fn headers(&self) -> &HeaderMap[src]

Returns request's headers.

pub fn set_payload(&mut self, payload: Payload)[src]

Set a body and return previous body value

pub fn take_payload(&mut self) -> Payload[src]

Get response's payload

pub fn extensions(&self) -> Ref<'_, Extensions>[src]

Request extensions

pub fn extensions_mut(&self) -> RefMut<'_, Extensions>[src]

Mutable reference to a the request's extensions

impl ClientResponse[src]

pub fn body(&mut self) -> MessageBody

Notable traits for MessageBody

impl Future for MessageBody type Output = Result<Bytes, PayloadError>;
[src]

Loads http response's body.

pub fn json<T: DeserializeOwned>(&mut self) -> JsonBody<T>

Notable traits for JsonBody<U>

impl<U> Future for JsonBody<U> where
    U: DeserializeOwned
type Output = Result<U, JsonPayloadError>;
[src]

Loads and parse application/json encoded body. Return JsonBody<T> future. It resolves to a T value.

Returns error:

  • content type is not application/json
  • content length is greater than 256k

Trait Implementations

impl Debug for ClientResponse[src]

impl HttpMessage for ClientResponse[src]

fn cookies(&self) -> Result<Ref<'_, Vec<Cookie<'static>>>, CookieParseError>[src]

Load request cookies.

impl Stream for ClientResponse[src]

type Item = Result<Bytes, PayloadError>

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,