pub trait Client: Sized {
type InternalClient;
type RB;
// Required methods
fn new(
api_key: impl Into<String>,
client: Self::InternalClient,
base_url: impl Into<String>
) -> Self;
fn with_api_key(
api_key: impl Into<String>,
base_url: impl Into<String>
) -> LTAResult<Self>;
fn req_builder(&self, url: &str) -> Self::RB;
fn base_url(&self) -> &str;
}
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,
base_url: impl Into<String>
) -> Self
fn new( api_key: impl Into<String>, client: Self::InternalClient, base_url: impl Into<String> ) -> Self
General constructor for Self
sourcefn with_api_key(
api_key: impl Into<String>,
base_url: impl Into<String>
) -> LTAResult<Self>
fn with_api_key( api_key: impl Into<String>, base_url: 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
Object Safety§
This trait is not object safe.