data dns
Namespace of name resolution functions.
Example:
use std.net { dns, IpAddr }
fn main() io, net {
match dns.lookup("127.0.0.1") {
List<IpAddr> ips => print(ips[0].toString())
NetError _ => print("failed")
}
}Вывод
127.0.0.1
pub(api) data dnsС версии. 1.0.0-beta
Методы
lookup | (host: str, timeout: Duration?) -> List<IpAddr> | NetError netAll IPv4 / IPv6 addresses of host (a name or a numeric address), in resolver order. |
Определено в: std/net/net.oxl:740