[][src]Struct scrappy_client::ClientResponse

pub struct ClientResponse<S = PayloadStream> { /* 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 = Result<Bytes, PayloadError>>, 
[src]

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

Loads http response's body.

Important traits for JsonBody<T, U>
pub fn json<T: DeserializeOwned>(&mut self) -> JsonBody<S, T>[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> Debug for ClientResponse<S>[src]

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

type Stream = S

Type of message payload stream

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

Load request cookies.

impl<S> Stream for ClientResponse<S> where
    S: Stream<Item = Result<Bytes, PayloadError>> + Unpin
[src]

type Item = Result<Bytes, PayloadError>

Values yielded by the stream.

Auto Trait Implementations

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

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

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

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

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

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, 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
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

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
[src]

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