tetrio_api/http/clients/
http_client.rs

1use std::fmt::Debug;
2
3use bytes::Bytes;
4use http::Request;
5
6
7#[async_trait::async_trait]
8pub trait HttpClient: 'static + Send + Sync {
9    type HttpError: Debug + std::error::Error + Sync + Send;
10    /// Executes a request. This is called automatically on every API request by the rate limiting middleware.
11    async fn execute(&self, request: Request<Vec<u8>>) -> Result<Bytes, Self::HttpError>;
12}
13