pub trait Host: HostResolveAddressStream {
    // Required method
    fn resolve_addresses<'life0, 'async_trait>(
        &'life0 mut self,
        network: Resource<Network>,
        name: String
    ) -> Pin<Box<dyn Future<Output = Result<Result<Resource<ResolveAddressStream>, ErrorCode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn resolve_addresses<'life0, 'async_trait>( &'life0 mut self, network: Resource<Network>, name: String ) -> Pin<Box<dyn Future<Output = Result<Result<Resource<ResolveAddressStream>, ErrorCode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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§