pub trait Client: Sized {
type InternalClient;
type RB;
// Required methods
fn new(api_key: impl Into<String>, client: Self::InternalClient) -> Self;
fn with_api_key(api_key: impl Into<String>) -> LTAResult<Self>;
fn req_builder(&self, url: &str) -> Self::RB;
}Expand description
A Client to make requests with
The Client holds a connection pool internally, so it is advised that you create one and reuse it
Required Associated Types§
Sourcetype InternalClient
type InternalClient
Any backend Client
Required Methods§
Sourcefn new(api_key: impl Into<String>, client: Self::InternalClient) -> Self
fn new(api_key: impl Into<String>, client: Self::InternalClient) -> Self
General constructor for Self
Sourcefn with_api_key(api_key: impl Into<String>) -> LTAResult<Self>
fn with_api_key(api_key: impl Into<String>) -> LTAResult<Self>
This method not assign the api_key in struct if the provided key is empty or whitespaces
Instead, assign None
Sourcefn req_builder(&self, url: &str) -> Self::RB
fn req_builder(&self, url: &str) -> Self::RB
Returns Self::RB
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.