try_init_global_dns_resolver

Function try_init_global_dns_resolver 

pub fn try_init_global_dns_resolver(
    resolver: impl DnsResolver,
) -> Result<(), BoxDnsResolver>
Available on crate feature dns only.
Expand description

Tries to initialise the global DnsResolver.

This returns the input DnsResolver boxed but useless back, in case the global DnsResolver was already set.

You can use init_global_dns_resolver should you want to panic on failure instead.