async_rs/traits/
addr.rs

1use std::{io, net::SocketAddr};
2
3/// A common interface for resolving domain name + port to `SocketAddr`
4pub trait AsyncToSocketAddrs {
5    /// Resolve the domain name through DNS and return an `Iterator` of `SocketAddr`
6    fn to_socket_addrs(
7        self,
8    ) -> impl Future<Output = io::Result<impl Iterator<Item = SocketAddr> + Send>> + Send
9    where
10        Self: Sized;
11}