[−][src]Trait trust_dns_proto::xfer::DnsRequestSender
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.
Associated Types
type DnsResponseFuture: Future<Item = DnsResponse, Error = ProtoError> + 'static + Send
A future that resolves to a response serial message
Required methods
fn send_message(&mut self, message: DnsRequest) -> Self::DnsResponseFuture
Send a message, and return a future of the response
Return
A future which will resolve to a SerialMessage response
fn error_response(error: ProtoError) -> Self::DnsResponseFuture
Constructs an error response
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 Ok(Async::Ready(()))
. This is not required though, if there are say outstanding requests that are not yet comlete, then it would be correct to first wait for those results.
fn is_shutdown(&self) -> bool
Returns true if the stream has been shutdown with shutdown
Implementors
impl<MF: MessageFinalizer> DnsRequestSender for UdpClientStream<MF>
[src]
impl<MF: MessageFinalizer> DnsRequestSender for UdpClientStream<MF>
type DnsResponseFuture = UdpResponse
fn send_message(&mut self, message: DnsRequest) -> Self::DnsResponseFuture | [src] |
fn error_response(err: ProtoError) -> Self::DnsResponseFuture | [src] |
fn shutdown(&mut self) | [src] |
fn is_shutdown(&self) -> bool | [src] |
impl<S, MF> DnsRequestSender for DnsMultiplexer<S, MF> where
S: DnsClientStream + 'static,
MF: MessageFinalizer + Send + Sync + 'static,
[src]
impl<S, MF> DnsRequestSender for DnsMultiplexer<S, MF> where
S: DnsClientStream + 'static,
MF: MessageFinalizer + Send + Sync + 'static,
type DnsResponseFuture = DnsMultiplexerSerialResponse
fn send_message(&mut self, request: DnsRequest) -> Self::DnsResponseFuture | [src] |
fn error_response(error: ProtoError) -> Self::DnsResponseFuture | [src] |
fn shutdown(&mut self) | [src] |
fn is_shutdown(&self) -> bool | [src] |