HostWithStore

Trait HostWithStore 

Source
pub trait HostWithStore: HasData + Send {
    // Required method
    fn resolve_addresses<T>(
        accessor: &Accessor<T, Self>,
        name: String,
    ) -> impl Future<Output = Result<Result<Vec<IpAddress>, ErrorCode>>> + Send;
}
Available on crate feature p3 only.

Required Methods§

Source

fn resolve_addresses<T>( accessor: &Accessor<T, Self>, name: String, ) -> impl Future<Output = Result<Result<Vec<IpAddress>, ErrorCode>>> + Send

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.

The results are returned in connection order preference.

This function never succeeds with 0 results. It either fails or succeeds with at least one address. Additionally, this function never returns IPv4-mapped IPv6 addresses.

The returned future will resolve to an error code in case of failure. It will resolve to success once the returned stream is exhausted.

§References:

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§