Trait lta::Client

source ·
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§

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, base_url: impl Into<String> ) -> Self

General constructor for Self

source

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

source

fn req_builder(&self, url: &str) -> Self::RB

Returns Self::RB

source

fn base_url(&self) -> &str

Returns the base URL that is set by user

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Client for lta::async::client::LTAClient<Client>

§

type InternalClient = Client

§

type RB = RequestBuilder

source§

impl Client for lta::blocking::client::LTAClient<Client>

source§

impl Client for lta::blocking::client::LTAClient<Agent>

§

type InternalClient = Agent

§

type RB = Request