Trait wasmtime_wasi::bindings::sockets::ip_name_lookup::Host
source · pub trait Host: Send + HostResolveAddressStream {
// Required method
fn resolve_addresses(
&mut self,
network: Resource<Network>,
name: String,
) -> Result<Resource<ResolveAddressStream>, SocketError>;
}
Required Methods§
sourcefn resolve_addresses(
&mut self,
network: Resource<Network>,
name: String,
) -> Result<Resource<ResolveAddressStream>, SocketError>
fn resolve_addresses( &mut self, network: Resource<Network>, name: String, ) -> Result<Resource<ResolveAddressStream>, SocketError>
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:
Implementations on Foreign Types§
source§impl<_T: Host + ?Sized + Send> Host for &mut _T
impl<_T: Host + ?Sized + Send> Host for &mut _T
source§fn resolve_addresses(
&mut self,
network: Resource<Network>,
name: String,
) -> Result<Resource<ResolveAddressStream>, SocketError>
fn resolve_addresses( &mut self, network: Resource<Network>, name: String, ) -> Result<Resource<ResolveAddressStream>, SocketError>
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.