Struct wasi::sockets::ip_name_lookup::ResolveAddressStream

source ·
pub struct ResolveAddressStream { /* private fields */ }

Implementations§

source§

impl ResolveAddressStream

source

pub fn resolve_next_address(&self) -> Result<Option<IpAddress>, ErrorCode>

Returns the next address from the resolver.

This function should be called multiple times. On each call, it will return the next address in connection order preference. If all addresses have been exhausted, this function returns none.

This function never returns IPv4-mapped IPv6 addresses.

§Typical errors
  • name-unresolvable: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY)
  • temporary-resolver-failure: A temporary failure in name resolution occurred. (EAI_AGAIN)
  • permanent-resolver-failure: A permanent failure in name resolution occurred. (EAI_FAIL)
  • would-block: A result is not available yet. (EWOULDBLOCK, EAGAIN)
source§

impl ResolveAddressStream

source

pub fn subscribe(&self) -> Pollable

Create a pollable which will resolve once the stream is ready for I/O.

Note: this function is here for WASI Preview2 only. It’s planned to be removed when future is natively supported in Preview3.

Trait Implementations§

source§

impl Debug for ResolveAddressStream

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.