#[non_exhaustive]pub enum BuiltinProvider {
GoogleStun,
GoogleStun1,
GoogleStun2,
CloudflareStun,
GoogleDns,
CloudflareDns,
OpenDns,
CloudflareHttp,
Aws,
}Expand description
Built-in IP detection providers
Each variant represents a specific provider service.
Use with Config::builder() to select which providers to use.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GoogleStun
Google STUN server (stun.l.google.com)
GoogleStun1
Google STUN server 1 (stun1.l.google.com)
GoogleStun2
Google STUN server 2 (stun2.l.google.com)
CloudflareStun
Cloudflare STUN server (stun.cloudflare.com)
GoogleDns
Google DNS via o-o.myaddr.l.google.com TXT
CloudflareDns
Cloudflare DNS via whoami.cloudflare TXT/CH
OpenDns
OpenDNS via myip.opendns.com
CloudflareHttp
Cloudflare 1.1.1.1/cdn-cgi/trace
Aws
AWS checkip.amazonaws.com
Implementations§
Source§impl BuiltinProvider
impl BuiltinProvider
Sourcepub const ALL: &'static [BuiltinProvider]
pub const ALL: &'static [BuiltinProvider]
All available built-in providers, ordered by expected performance.
Providers with both IPv4 and IPv6 support are listed first, followed by IPv4-only providers. Within each tier, UDP-based protocols (STUN, DNS) are preferred over HTTP due to lower overhead (no TLS handshake).
This order is used by Strategy::First.
Run the benchmark example to find the optimal order for your network:
cargo run --example benchmark --all-features
Trait Implementations§
Source§impl Clone for BuiltinProvider
impl Clone for BuiltinProvider
Source§fn clone(&self) -> BuiltinProvider
fn clone(&self) -> BuiltinProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more