#[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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuiltinProvider
impl Debug for BuiltinProvider
Source§impl Display for BuiltinProvider
impl Display for BuiltinProvider
Source§impl Hash for BuiltinProvider
impl Hash for BuiltinProvider
Source§impl PartialEq for BuiltinProvider
impl PartialEq for BuiltinProvider
impl Copy for BuiltinProvider
impl Eq for BuiltinProvider
impl StructuralPartialEq for BuiltinProvider
Auto Trait Implementations§
impl Freeze for BuiltinProvider
impl RefUnwindSafe for BuiltinProvider
impl Send for BuiltinProvider
impl Sync for BuiltinProvider
impl Unpin for BuiltinProvider
impl UnsafeUnpin for BuiltinProvider
impl UnwindSafe for BuiltinProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.