pub trait HasAddrs {
// Required method
fn addrs(&self) -> impl Iterator<Item = SocketAddr>;
}Expand description
An object that represents a host on the network which may have known IP addresses.
Required Methods§
Sourcefn addrs(&self) -> impl Iterator<Item = SocketAddr>
fn addrs(&self) -> impl Iterator<Item = SocketAddr>
Return the addresses listed for this server.
NOTE that these addresses are not necessarily ones that we should connect to directly! They can be useful for telling where a server is located, or whether it is “close” to another server, but without knowing the associated protocols you cannot use these to launch a connection.
Also, for some servers, we may not actually have any relevant addresses; in that case, the returned slice is empty.
To see how to connect to a relay, use HasChanMethod::chan_method
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.