hickory_proto::xfer

Trait DnsRequestSender

Source
pub trait DnsRequestSender:
    Stream<Item = Result<(), ProtoError>>
    + Send
    + Unpin
    + 'static {
    // Required methods
    fn send_message(&mut self, message: DnsRequest) -> DnsResponseStream;
    fn shutdown(&mut self);
    fn is_shutdown(&self) -> bool;
}
Expand description

Types that implement this are capable of sending a serialized DNS message on a stream

The underlying Stream implementation should yield Some(()) whenever it is ready to send a message, NotReady, if it is not ready to send a message, and Err or None in the case that the stream is done, and should be shutdown.

Required Methods§

Source

fn send_message(&mut self, message: DnsRequest) -> DnsResponseStream

Send a message, and return a stream of response

§Return

A stream which will resolve to SerialMessage responses

Source

fn shutdown(&mut self)

Allows the upstream user to inform the underling stream that it should shutdown.

After this is called, the next time poll is called on the stream it would be correct to return Poll::Ready(Ok(())). This is not required though, if there are say outstanding requests that are not yet complete, then it would be correct to first wait for those results.

Source

fn is_shutdown(&self) -> bool

Returns true if the stream has been shutdown with shutdown

Implementors§

Source§

impl DnsRequestSender for HttpsClientStream

Available on crate feature dns-over-https-rustls only.
Source§

impl DnsRequestSender for H3ClientStream

Available on crate feature dns-over-h3 only.
Source§

impl DnsRequestSender for QuicClientStream

Available on crate features dns-over-quic and tokio-runtime only.
Source§

impl<P: RuntimeProvider> DnsRequestSender for UdpClientStream<P>

Source§

impl<S> DnsRequestSender for DnsMultiplexer<S>
where S: DnsClientStream + Unpin + 'static,