pub trait Provider: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn protocol(&self) -> Protocol;
fn get_ip<'life0, 'async_trait>(
&'life0 self,
version: IpVersion,
) -> Pin<Box<dyn Future<Output = Result<IpAddr, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn supports_v4(&self) -> bool { ... }
fn supports_v6(&self) -> bool { ... }
fn supports_version(&self, version: IpVersion) -> bool { ... }
}Expand description
Trait for IP detection providers
Required Methods§
Provided Methods§
Sourcefn supports_v4(&self) -> bool
fn supports_v4(&self) -> bool
Whether this provider supports IPv4
Sourcefn supports_v6(&self) -> bool
fn supports_v6(&self) -> bool
Whether this provider supports IPv6
Sourcefn supports_version(&self, version: IpVersion) -> bool
fn supports_version(&self, version: IpVersion) -> bool
Check if provider supports the given IP version