OxL Справочник OxL
РусскийEnglish

data dns

Namespace of name resolution functions.

Example:

oxl✓ проверяется в CI
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 net
All IPv4 / IPv6 addresses of host (a name or a numeric address), in resolver order.

Определено в: std/net/net.oxl:740

См. также