pub trait AsyncHttpClient {
// Required methods
fn send<'a>(&'a mut self, request: &'a HttpRequest) -> SendFuture<'a>;
fn sleep(&self, duration: Duration) -> SleepFuture<'_>;
}Expand description
Performs a request without blocking the thread.
Required Methods§
Sourcefn send<'a>(&'a mut self, request: &'a HttpRequest) -> SendFuture<'a>
fn send<'a>(&'a mut self, request: &'a HttpRequest) -> SendFuture<'a>
Sourcefn sleep(&self, duration: Duration) -> SleepFuture<'_>
fn sleep(&self, duration: Duration) -> SleepFuture<'_>
Wait for duration.
A retry may ask for a delay, and an executor that performs no IO has no runtime to wait on either — the client, which has one, says how. A test client can return immediately.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".