Trait ToSocketAddrs
trait ToSocketAddrs: sealed::ToSocketAddrsPriv
Converts or resolves without blocking to one or more SocketAddr values.
DNS
Implementations of ToSocketAddrs for string types require a DNS lookup.
Calling
Currently, this trait is only used as an argument to Tokio functions that
need to reference a target socket address. To perform a SocketAddr
conversion directly, use lookup_host().
This trait is sealed and is intended to be opaque. The details of the trait will change. Stabilization is pending enhancements to the Rust language.
Implementors
impl ToSocketAddrs for Stringimpl ToSocketAddrs for (Ipv4Addr, u16)impl ToSocketAddrs for strimpl ToSocketAddrs for SocketAddrimpl ToSocketAddrs for (Ipv6Addr, u16)impl ToSocketAddrs for (String, u16)impl ToSocketAddrs for SocketAddrV4impl ToSocketAddrs for &[SocketAddr]impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &Timpl ToSocketAddrs for SocketAddrV6impl ToSocketAddrs for (&str, u16)impl ToSocketAddrs for (IpAddr, u16)