Skip to main content

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>>;
    fn text(
        self: Box<Self>,
    ) -> Pin<Box<dyn Future<Output = Result<String, RequestError>> + Send>>;

    // Provided method
    fn version(&self) -> Version { ... }
}
Available on crate feature fullstack only.

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>>

Source

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

Provided Methods§

Source

fn version(&self) -> Version

Implementors§