pub struct IpInfoProvider { /* private fields */ }Expand description
An IP information provider.
Implementations§
Source§impl IpInfoProvider
impl IpInfoProvider
Sourcepub fn new_api_provider(url: &str, api_key: &str, fields: ApiFields) -> Self
pub fn new_api_provider(url: &str, api_key: &str, fields: ApiFields) -> Self
Returns a new API-based IpInfoProvider.
§Arguments
url- The URL of the API endpoint. The string “{ip}” will be replaced with the IP address, and “{api_key}” with the API key, if any.api_key- The API key to use.fields- The fields to request from the API.
Sourcepub fn new_mmdb_provider(
location_url: &str,
asn_url: &str,
api_key: &str,
refresh_days: u64,
) -> Self
pub fn new_mmdb_provider( location_url: &str, asn_url: &str, api_key: &str, refresh_days: u64, ) -> Self
Returns a new MMDB-based IpInfoProvider.
§Arguments
location_url- The URL of the location MMDB file. The string “{api_key}” will be replaced with the API key, if any.asn_url- The URL of the ASN MMDB file. The string “{api_key}” will be replaced with the API key, if any.api_key- The API key to use.refresh_days- The number of days to wait before refreshing the MMDB files.
Auto Trait Implementations§
impl Freeze for IpInfoProvider
impl RefUnwindSafe for IpInfoProvider
impl Send for IpInfoProvider
impl Sync for IpInfoProvider
impl Unpin for IpInfoProvider
impl UnwindSafe for IpInfoProvider
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