[−][src]Struct lta::lta_client::LTAClient
A Client
to make requests with
The Client
holds a connection pool internally, so it is advised that you create one and reuse it
There are some instance where you might need to customise your client due to certain limitations.
The Client
trait has a general constructor method and you should use the reqwest
re-export
to build you own customised client from the ground up.
Take a look at the reqwest documentation on how to build your own client
Example
use std::time::Duration; use lta::reqwest::ClientBuilder; use lta::lta_client::LTAClient; use lta::utils::commons::Client; fn my_custom_client() -> LTAClient { let client = ClientBuilder::new() .gzip(true) .connect_timeout(Some(Duration::new(420,0))) .build() .unwrap(); LTAClient::new(Some("api_key".to_string()), client) }
Trait Implementations
impl Client<Client, RequestBuilder> for LTAClient
[src]
type Output = LTAClient
fn new(api_key: Option<String>, client: Client) -> LTAClient
[src]
fn with_api_key<S>(api_key: S) -> LTAClient where
S: Into<String>,
[src]
S: Into<String>,
fn get_req_builder(&self, url: &str) -> RequestBuilder
[src]
impl Clone for LTAClient
[src]
impl Debug for LTAClient
[src]
Auto Trait Implementations
impl Send for LTAClient
impl Unpin for LTAClient
impl Sync for LTAClient
impl !UnwindSafe for LTAClient
impl !RefUnwindSafe for LTAClient
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,