pub trait ToSocketAddrs {
type Iter: Iterator<Item = Self::SocketAddr>;
type SocketAddr: SocketAddrExt + Copy;
type Error: Debug;
// Required method
fn to_socket_addrs(&self) -> Result<Self::Iter, Self::Error>;
}
Expand description
A flavor of std::net::ToSocketAddrs
that allows the implementation of
SocketAddr
to be replaced.
This is necessary to enable support for things like CoAP-over-SMS, where socket addresses are telephone numbers.
Required Associated Types§
Sourcetype Iter: Iterator<Item = Self::SocketAddr>
type Iter: Iterator<Item = Self::SocketAddr>
Analogous to std::net::ToSocketAddrs::Iter
Sourcetype SocketAddr: SocketAddrExt + Copy
type SocketAddr: SocketAddrExt + Copy
The SocketAddr
type returned by the above iterator.
Required Methods§
Sourcefn to_socket_addrs(&self) -> Result<Self::Iter, Self::Error>
fn to_socket_addrs(&self) -> Result<Self::Iter, Self::Error>
Analogous to std::net::ToSocketAddrs::to_socket_addrs
Implementors§
Source§impl ToSocketAddrs for LoopbackSocketAddr
impl ToSocketAddrs for LoopbackSocketAddr
type Iter = IntoIter<<LoopbackSocketAddr as ToSocketAddrs>::SocketAddr>
type SocketAddr = LoopbackSocketAddr
type Error = Error
Source§impl ToSocketAddrs for NullSocketAddr
impl ToSocketAddrs for NullSocketAddr
type Iter = IntoIter<<NullSocketAddr as ToSocketAddrs>::SocketAddr>
type SocketAddr = NullSocketAddr
type Error = Error
Source§impl<T, I> ToSocketAddrs for T
Blanket implementation of ToSocketAddrs
for all implementations of std::net::ToSocketAddrs
.
impl<T, I> ToSocketAddrs for T
Blanket implementation of ToSocketAddrs
for all implementations of std::net::ToSocketAddrs
.