pub trait AsyncClient:
Clone
+ Send
+ Sync
+ 'static {
type Response: AsyncResponse + Send;
// Required method
fn request(
&self,
req: AsyncRequest,
) -> impl Future<Output = Result<Self::Response>> + Send;
// Provided method
fn describe(&self, f: &mut Formatter<'_>) -> Result { ... }
}
Available on crate feature
async
only.Expand description
Trait for asynchronous HTTP clients.
Backend implementations must provide a concrete type that implements this trait to handle asynchronous HTTP requests.
Required Associated Types§
Sourcetype Response: AsyncResponse + Send
type Response: AsyncResponse + Send
The type of response returned by this client.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.