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§
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 Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".