pub trait SocketAddressEnumeratorExt: 'static {
    fn next(
        cancellable: Option<&impl IsA<Cancellable>>
    ) -> Result<SocketAddress, Error>; fn next_async<P: FnOnce(Result<SocketAddress, Error>) + 'static>(
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P
    ); fn next_future(
    ) -> Pin<Box_<dyn Future<Output = Result<SocketAddress, Error>> + 'static>>; }
Expand description

Required Methods

Retrieves the next SocketAddress from self. Note that this may block for some amount of time. (Eg, a NetworkAddress may need to do a DNS lookup before it can return an address.) Use next_async() if you need to avoid blocking.

If self is expected to yield addresses, but for some reason is unable to (eg, because of a DNS error), then the first call to next() will return an appropriate error in *error. However, if the first call to next() succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.


optional Cancellable object, None to ignore.


a SocketAddress (owned by the caller), or None on error (in which case *error will be set) or if there are no more addresses.

Asynchronously retrieves the next SocketAddress from self and then calls callback, which must call g_socket_address_enumerator_next_finish() to get the result.

It is an error to call this multiple times before the previous callback has finished.


optional Cancellable object, None to ignore.


a GAsyncReadyCallback to call when the request is satisfied