Trait async_std::net::ToSocketAddrs [−][src]
pub trait ToSocketAddrs { type Iter: Iterator<Item = SocketAddr>; fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>; }
Converts or resolves addresses to SocketAddr
values.
This trait is an async version of std::net::ToSocketAddrs
.
Examples
use async_std::net::ToSocketAddrs; let addr = "localhost:8080".to_socket_addrs().await?.next().unwrap(); println!("resolved: {:?}", addr);
Associated Types
type Iter: Iterator<Item = SocketAddr>
[src]
Returned iterator over socket addresses which this type may correspond to.
Required methods
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
Converts this object to an iterator of resolved SocketAddr
s.
The returned iterator may not actually yield any values depending on the outcome of any resolution performed.
Note that this function may block a backend thread while resolution is performed.
Implementations on Foreign Types
impl ToSocketAddrs for (IpAddr, u16)
[src]
impl ToSocketAddrs for (IpAddr, u16)
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for (Ipv4Addr, u16)
[src]
impl ToSocketAddrs for (Ipv4Addr, u16)
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for (Ipv6Addr, u16)
[src]
impl ToSocketAddrs for (Ipv6Addr, u16)
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for (&str, u16)
[src]
impl ToSocketAddrs for (&str, u16)
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for str
[src]
impl ToSocketAddrs for str
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl<'a> ToSocketAddrs for &'a [SocketAddr]
[src]
impl<'a> ToSocketAddrs for &'a [SocketAddr]
[src]type Iter = Cloned<Iter<'a, SocketAddr>>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &T
[src]
impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &T
[src]type Iter = T::Iter
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for String
[src]
impl ToSocketAddrs for String
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
Implementors
impl ToSocketAddrs for SocketAddr
[src]
impl ToSocketAddrs for SocketAddr
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for SocketAddrV4
[src]
impl ToSocketAddrs for SocketAddrV4
[src]type Iter = IntoIter<SocketAddr>
fn to_socket_addrs(&self) -> ToSocketAddrsFuture<Self::Iter>
[src]
impl ToSocketAddrs for SocketAddrV6
[src]
impl ToSocketAddrs for SocketAddrV6
[src]