hickory_proto::xfer

Trait FirstAnswer

Source
pub trait FirstAnswer<T, E: From<ProtoError>>:
    Stream<Item = Result<T, E>>
    + Unpin
    + Sized {
    // Provided method
    fn first_answer(self) -> FirstAnswerFuture<Self>  { ... }
}
Expand description

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

Provided Methods§

Source

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", so this trait is not object safe.

Implementors§

Source§

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