Client

Trait Client 

Source
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§

Source

type InternalClient

Any backend Client

Source

type RB

Any type that can build requests

Required Methods§

Source

fn new(api_key: impl Into<String>, client: Self::InternalClient) -> Self

General constructor for Self

Source

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

Source

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.

Implementors§