pub trait Host: HostResolveAddressStream {
    // Required method
    fn resolve_addresses(
        &mut self,
        network: Resource<Network>,
        name: String
    ) -> Result<Result<Resource<ResolveAddressStream>, ErrorCode>>;
}

Required Methods§

source

fn resolve_addresses( &mut self, network: Resource<Network>, name: String ) -> Result<Result<Resource<ResolveAddressStream>, ErrorCode>>

Resolve an internet host name to a list of IP addresses.

Unicode domain names are automatically converted to ASCII using IDNA encoding. If the input is an IP address string, the address is parsed and returned as-is without making any external requests.

See the wasi-socket proposal README.md for a comparison with getaddrinfo.

This function never blocks. It either immediately fails or immediately returns successfully with a resolve-address-stream that can be used to (asynchronously) fetch the results.

§Typical errors
  • invalid-argument: name is a syntactically invalid domain name or IP address.
§References:

Implementors§