ClientResponseDriver

Trait ClientResponseDriver 

Source
pub trait ClientResponseDriver {
    // Required methods
    fn status(&self) -> StatusCode;
    fn headers(&self) -> &HeaderMap;
    fn url(&self) -> &Url;
    fn content_length(&self) -> Option<u64>;
    fn bytes(
        self: Box<Self>,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, RequestError>> + Send>>;
    fn bytes_stream(
        self: Box<Self>,
    ) -> Pin<Box<dyn Stream<Item = Result<Bytes, StreamingError>> + Unpin + Send + 'static>>;
    fn text(
        self: Box<Self>,
    ) -> Pin<Box<dyn Future<Output = Result<String, RequestError>> + Send>>;

    // Provided method
    fn version(&self) -> Version { ... }
}

Required Methods§

Source

fn status(&self) -> StatusCode

Source

fn headers(&self) -> &HeaderMap

Source

fn url(&self) -> &Url

Source

fn content_length(&self) -> Option<u64>

Source

fn bytes( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, RequestError>> + Send>>

Source

fn bytes_stream( self: Box<Self>, ) -> Pin<Box<dyn Stream<Item = Result<Bytes, StreamingError>> + Unpin + Send + 'static>>

Source

fn text( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<String, RequestError>> + Send>>

Provided Methods§

Source

fn version(&self) -> Version

Implementations on Foreign Types§

Source§

impl ClientResponseDriver for Response

Source§

fn status(&self) -> StatusCode

Source§

fn version(&self) -> Version

Source§

fn headers(&self) -> &HeaderMap

Source§

fn url(&self) -> &Url

Source§

fn content_length(&self) -> Option<u64>

Source§

fn bytes( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, RequestError>> + Send>>

Source§

fn bytes_stream( self: Box<Self>, ) -> Pin<Box<dyn Stream<Item = Result<Bytes, StreamingError>> + Unpin + Send + 'static>>

Source§

fn text( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<String, RequestError>> + Send>>

Implementors§