Skip to main content

AsyncClient

Trait AsyncClient 

Source
pub trait AsyncClient {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn send(
        &self,
        request: HttpRequest,
    ) -> impl Future<Output = Result<HttpResponse, Self::Error>> + Send;
}
Expand description

The same, for a caller inside a runtime. Send on the future so that a call can be tokio::spawned.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn send( &self, request: HttpRequest, ) -> impl Future<Output = Result<HttpResponse, Self::Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§