Trait tokio::net::ToSocketAddrs

source ·
pub trait ToSocketAddrs: ToSocketAddrsPriv { }
Expand description

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.

Implementations on Foreign Types§

source§

impl ToSocketAddrs for &[SocketAddr]

source§

impl ToSocketAddrs for (&str, u16)

source§

impl ToSocketAddrs for (IpAddr, u16)

source§

impl ToSocketAddrs for (String, u16)

source§

impl ToSocketAddrs for (Ipv4Addr, u16)

source§

impl ToSocketAddrs for (Ipv6Addr, u16)

source§

impl ToSocketAddrs for SocketAddr

source§

impl ToSocketAddrs for str

source§

impl ToSocketAddrs for String

source§

impl ToSocketAddrs for SocketAddrV4

source§

impl ToSocketAddrs for SocketAddrV6

source§

impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &T

Implementors§