pub trait HttpClient {
type Error: Error + Send + Sync + 'static;
// Required method
fn call<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An HTTP client capable of executing the requests made by MinecraftAuthorizationFlow.
The trait is asynchronous by default and becomes synchronous when the
is_sync feature is enabled. Implementations should be annotated with
maybe_async::maybe_async to support both modes.
An implementation for reqwest::Client ([reqwest::blocking::Client] with
is_sync) is provided behind the reqwest feature, which is enabled by
default.
Required Associated Types§
Required Methods§
Sourcefn call<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Executes the given request, returning the response with its full body.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".