pub struct Lookup { /* private fields */ }Expand description
A running DNS-SD lookup.
Call Self::next to receive resolved ServiceEntry values as they
complete; it returns None once every query (browse + resolves) has timed
out and the resolver has drained. Resolution progresses while
Self::next is awaited — the lookup races the underlying sub-queries
concurrently via futures::future::select_all, so the first query with
a buffered answer is processed without waiting on the others.
An instance may be yielded more than once as additional addresses resolve
(e.g. a late AAAA after the entry was first surfaced on its A address); a
later yield for the same ServiceEntry::instance_name supersedes the
earlier one. Dropping the Lookup cancels every in-flight sub-query.
Implementations§
Source§impl Lookup
impl Lookup
Sourcepub async fn next(&mut self) -> Option<ServiceEntry>
pub async fn next(&mut self) -> Option<ServiceEntry>
Wait for the next resolved service instance, or None when the lookup
is finished (every sub-query has terminated and the resolver has
drained).
The borrow on &mut self matches the single-consumer mailbox contract
inherited from Query::next: at most one Self::next is in flight
per Lookup.
Auto Trait Implementations§
impl !RefUnwindSafe for Lookup
impl !Send for Lookup
impl !Sync for Lookup
impl !UnwindSafe for Lookup
impl Freeze for Lookup
impl Unpin for Lookup
impl UnsafeUnpin for Lookup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more