Trait axstd::net::ToSocketAddrs

source ·
pub trait ToSocketAddrs {
    type Iter: Iterator<Item = SocketAddr>;

    // Required method
    fn to_socket_addrs(&self) -> Result<Self::Iter>;
}
Available on crate feature net only.
Expand description

A trait for objects which can be converted or resolved to one or more SocketAddr values.

This trait is used for generic address resolution when constructing network objects. By default it is implemented for the following types:

Required Associated Types§

source

type Iter: Iterator<Item = SocketAddr>

Returned iterator over socket addresses which this type may correspond to.

Required Methods§

source

fn to_socket_addrs(&self) -> Result<Self::Iter>

Converts this object to an iterator of resolved SocketAddrs.

Implementations on Foreign Types§

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 str

source§

impl ToSocketAddrs for String

source§

impl<'a> ToSocketAddrs for &'a [SocketAddr]

source§

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

Implementors§