kvarn_utils::prelude::net

Trait ToSocketAddrs

1.0.0 ยท source
pub trait ToSocketAddrs {
    type Iter: Iterator<Item = SocketAddr>;

    // Required method
    fn to_socket_addrs(&self) -> Result<Self::Iter, Error>;
}
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:

This trait allows constructing network objects like TcpStream or UdpSocket easily with values of various types for the b