pub trait ToSocketAddrs<R>: Send + Sync {
type Iter: Iterator<Item = SocketAddr> + Send + 'static;
type Future: Future<Output = Result<Self::Iter>> + Send + 'static;
// Required method
fn to_socket_addrs(&self) -> Self::Future
where R: RuntimeLite;
}Expand description
Converts or resolves without blocking base on your async runtime to one or more SocketAddr values.
§DNS
Implementations of ToSocketAddrs<R> for string types require a DNS lookup.
Required Associated Types§
Sourcetype Iter: Iterator<Item = SocketAddr> + Send + 'static
type Iter: Iterator<Item = SocketAddr> + Send + 'static
Returned iterator over socket addresses which this type may correspond to.
Required Methods§
Sourcefn to_socket_addrs(&self) -> Self::Futurewhere
R: RuntimeLite,
fn to_socket_addrs(&self) -> Self::Futurewhere
R: RuntimeLite,
Converts this object to an iterator of resolved SocketAddrs.
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.