Skip to main content

resolve_uri

Function resolve_uri 

Source
pub async fn resolve_uri<G: Rng + ?Sized>(
    uri: &Uri,
    resolver: &Arc<DnsResolver>,
    rng: &mut G,
) -> Vec<Target>
Expand description

Resolve a URI to an ordered candidate list, in one await (RFC 3263).

The two-step form — prefetch, then select — is what the endpoint uses, because it keeps every await off the loop where a slow nameserver would stop the transaction timers. This is the same thing for a caller that is not the loop: a forwarding element deciding where to send one request, which wants a list and does not want to know that resolution has two halves.

The selection is unchanged and still pure. Only the waiting is here.