pub struct BlockingIpApiClient {
pub client: Client,
pub limiter: Option<DefaultDirectRateLimiter>,
pub api_key: Option<String>,
}
Expand description
A client for the ip-api.com API that blocks the current thread.
Fields§
§client: Client
The client to use for the requests.
limiter: Option<DefaultDirectRateLimiter>
The rate limiter to use for the requests.
api_key: Option<String>
The API key to use for the requests.
Implementations§
Source§impl BlockingIpApiClient
impl BlockingIpApiClient
Sourcepub fn new_with_api_key(api_key: String) -> Self
pub fn new_with_api_key(api_key: String) -> Self
Creates a new BlockingIpApiClient with an API key.
Trait Implementations§
Source§impl BlockingIpApi for BlockingIpApiClient
impl BlockingIpApi for BlockingIpApiClient
Source§fn query_api_default(&self, ip: &str) -> Result<IpDefaultResponse, IpApiError>
fn query_api_default(&self, ip: &str) -> Result<IpDefaultResponse, IpApiError>
Queries the API with the default fields. Read more
Source§fn query_api_fully(&self, ip: &str) -> Result<IpFullResponse, IpApiError>
fn query_api_fully(&self, ip: &str) -> Result<IpFullResponse, IpApiError>
Queries the API with all fields. Read more
Source§fn query_api<T>(&self, ip: &str) -> Result<T, IpApiError>where
T: DeserializeOwned,
fn query_api<T>(&self, ip: &str) -> Result<T, IpApiError>where
T: DeserializeOwned,
Queries the API with a custom struct. Read more
Source§fn get_http_client(&self) -> &Client
fn get_http_client(&self) -> &Client
Gets you the blocking http client. Read more
Source§impl Default for BlockingIpApiClient
impl Default for BlockingIpApiClient
Source§impl IpApi for BlockingIpApiClient
impl IpApi for BlockingIpApiClient
Source§fn get_rate_limiter(&self) -> &Option<DefaultDirectRateLimiter>
fn get_rate_limiter(&self) -> &Option<DefaultDirectRateLimiter>
Gets the rate limiter. Read more
Auto Trait Implementations§
impl !Freeze for BlockingIpApiClient
impl !RefUnwindSafe for BlockingIpApiClient
impl Send for BlockingIpApiClient
impl Sync for BlockingIpApiClient
impl Unpin for BlockingIpApiClient
impl !UnwindSafe for BlockingIpApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more