pub trait Client: Debug {
// Required methods
fn get(
&self,
url: &Url,
params: &[(&str, &str)],
) -> impl Future<Output = Result<(u16, Arc<String>), ClientError>>;
fn get_bin(
&self,
url: &Url,
params: &[(&str, &str)],
) -> impl Future<Output = Result<(u16, Arc<Vec<u8>>), ClientError>>;
}Expand description
Backend client implementation trait
This trait needs to be implemented by clients to be used by auditors, monitors etc.
Required Methods§
Sourcefn get(
&self,
url: &Url,
params: &[(&str, &str)],
) -> impl Future<Output = Result<(u16, Arc<String>), ClientError>>
fn get( &self, url: &Url, params: &[(&str, &str)], ) -> impl Future<Output = Result<(u16, Arc<String>), ClientError>>
Sourcefn get_bin(
&self,
url: &Url,
params: &[(&str, &str)],
) -> impl Future<Output = Result<(u16, Arc<Vec<u8>>), ClientError>>
fn get_bin( &self, url: &Url, params: &[(&str, &str)], ) -> impl Future<Output = Result<(u16, Arc<Vec<u8>>), ClientError>>
Make a GET request to fetch some binary data
§Arguments
url: theUrlto connect toparams: Key-value pairs of query parameters to be included in the request
§Returns
- On success:
- The HTTP status code
- The data as a
Vec<u8>
- On failure: The
ClientErrordescribing what went wrong
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.