[][src]Struct actix_web::client::ClientResponse

pub struct ClientResponse<S = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> { /* fields omitted */ }

Client Response

Methods

impl<S> ClientResponse<S>[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 headers(&self) -> &HeaderMap[src]

Returns request's headers.

pub fn map_body<F, U>(self, f: F) -> ClientResponse<U> where
    F: FnOnce(&mut ResponseHead, Payload<S>) -> Payload<U>, 
[src]

Set a body and return previous body value

impl<S> ClientResponse<S> where
    S: Stream<Item = Bytes, Error = PayloadError>, 
[src]

pub fn body(&mut self) -> MessageBody<S>[src]

Loads http response's body.

pub fn json<T>(&mut self) -> JsonBody<S, T> where
    T: DeserializeOwned
[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<S> Stream for ClientResponse<S> where
    S: Stream<Item = Bytes, Error = PayloadError>, 
[src]

type Item = Bytes

The type of item this stream will yield on success.

type Error = PayloadError

The type of error this stream may generate.

impl<S> HttpMessage for ClientResponse<S>[src]

type Stream = S

Type of message payload stream

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

Load request cookies.

impl<S> Debug for ClientResponse<S>[src]

Auto Trait Implementations

impl<S = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !Send for ClientResponse<S>

impl<S> Unpin for ClientResponse<S> where
    S: Unpin

impl<S = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !Sync for ClientResponse<S>

impl<S = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !UnwindSafe for ClientResponse<S>

impl<S = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !RefUnwindSafe for ClientResponse<S>

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<T> IntoStream for T where
    T: Stream
[src]

type Item = <T as Stream>::Item

type Error = <T as Stream>::Error

type Stream = T

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