Trait embedded_nal::Dns [−][src]
pub trait Dns { type Error: Debug; fn get_host_by_name(
&self,
hostname: &str,
addr_type: AddrType
) -> Result<IpAddr, Self::Error>; fn get_host_by_address(
&self,
addr: IpAddr
) -> Result<String<256>, Self::Error>; }
Expand description
This trait is an extension trait for TcpStack
and UdpStack
for dns
resolutions. It does not handle every DNS record type, but is meant as an
embedded alternative to ToSocketAddrs
, and is as such meant to resolve
an ip address from a hostname, or a hostname from an ip address. This means
that it only deals in host address records A
(IPv4) and AAAA
(IPv6).