Skip to main content

ToSocketAddrs

Trait ToSocketAddrs 

Source
pub trait ToSocketAddrs: Sealed { }
Expand description

What an operation that takes an address accepts: a SocketAddr, an (IpAddr, u16) pair, a slice or array of addresses, or a string, "host:port" or ("host", port). Numbers are used as they are; a name is looked up on the blocking pool (getaddrinfo), never on the calling thread.

The trait is sealed: its implementations are the ones listed here.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToSocketAddrs for (&str, u16)

Source§

impl ToSocketAddrs for (IpAddr, u16)

Source§

impl ToSocketAddrs for (Ipv4Addr, u16)

Source§

impl ToSocketAddrs for (Ipv6Addr, u16)

Source§

impl ToSocketAddrs for (String, u16)

Source§

impl ToSocketAddrs for SocketAddr

Source§

impl ToSocketAddrs for SocketAddrV4

Source§

impl ToSocketAddrs for SocketAddrV6

Source§

impl ToSocketAddrs for String

Source§

impl ToSocketAddrs for [SocketAddr]

Source§

impl ToSocketAddrs for str

Source§

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

Source§

impl<const N: usize> ToSocketAddrs for [SocketAddr; N]

Implementors§