Trait trust_dns_proto::xfer::FirstAnswer
source · [−]pub trait FirstAnswer<T, E: From<ProtoError>>: Stream<Item = Result<T, E>> + Unpin + Sized {
fn first_answer(self) -> FirstAnswerFuture<Self>ⓘNotable traits for FirstAnswerFuture<S>impl<E, S: Stream<Item = Result<T, E>> + Unpin, T> Future for FirstAnswerFuture<S> where
S: Stream<Item = Result<T, E>> + Unpin + Sized,
E: From<ProtoError>, type Output = S::Item;
{ ... }
}
Expand description
Helper trait to convert a Stream of dns response into a Future
Provided methods
fn first_answer(self) -> FirstAnswerFuture<Self>ⓘNotable traits for FirstAnswerFuture<S>impl<E, S: Stream<Item = Result<T, E>> + Unpin, T> Future for FirstAnswerFuture<S> where
S: Stream<Item = Result<T, E>> + Unpin + Sized,
E: From<ProtoError>, type Output = S::Item;
fn first_answer(self) -> FirstAnswerFuture<Self>ⓘNotable traits for FirstAnswerFuture<S>impl<E, S: Stream<Item = Result<T, E>> + Unpin, T> Future for FirstAnswerFuture<S> where
S: Stream<Item = Result<T, E>> + Unpin + Sized,
E: From<ProtoError>, type Output = S::Item;
S: Stream<Item = Result<T, E>> + Unpin + Sized,
E: From<ProtoError>, type Output = S::Item;
Convert a Stream of dns response into a Future yielding the first answer, discarding others if any.