pub fn prefer_family(
addresses: &mut [SocketAddr],
preference: IpFamilyPreference,
)Expand description
Reorders addresses so the preferred address family comes first.
A stable partition rather than a sort: within one family the resolver’s own
order survives untouched, so whatever RFC 6724 decided between two IPv6
addresses (or two IPv4 ones) still decides which of them is tried first. Only
the choice between the families is taken away from the resolver, because
only that choice is an operator’s to make — see IpFamilyPreference.
System leaves the list exactly as it arrived.
A list that is empty or single-family — an IP literal is always the latter —
is unchanged by any preference.