Skip to main content

AsyncHttpClient

Trait AsyncHttpClient 

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

Source

fn send<'a>(&'a mut self, request: &'a HttpRequest) -> SendFuture<'a>

Send request and return what came back.

§Errors

As HttpClient::send.

Source

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

Implementors§