Skip to main content

FirstAnswer

Trait FirstAnswer 

pub trait FirstAnswer<T, E>:
    Sized
    + Stream<Item = Result<T, E>>
    + Unpin
where E: From<ProtoError>,
{ // Provided method fn first_answer(self) -> FirstAnswerFuture<Self> { ... } }
Available on crate features dns and hickory only.
Expand description

Helper trait to convert a Stream of dns response into a Future

Provided Methods§

fn first_answer(self) -> FirstAnswerFuture<Self>

Convert a Stream of dns response into a Future yielding the first answer, discarding others if any.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<E, S, T> FirstAnswer<T, E> for S
where S: Stream<Item = Result<T, E>> + Unpin, E: From<ProtoError>,