pub struct DnsExchange { /* private fields */ }
Expand description
This is a generic Exchange implemented over multiplexed DNS connection providers.
The underlying DnsRequestSender
is expected to multiplex any I/O connections. DnsExchange assumes that the underlying stream is responsible for this.
Implementations§
Source§impl DnsExchange
impl DnsExchange
Sourcepub fn from_stream<S, TE>(stream: S) -> (Self, DnsExchangeBackground<S, TE>)
pub fn from_stream<S, TE>(stream: S) -> (Self, DnsExchangeBackground<S, TE>)
Initializes a TcpStream with an existing tcp::TcpStream.
This is intended for use with a TcpListener and Incoming.
§Arguments
stream
- the established IO stream for communication
Sourcepub fn from_stream_with_receiver<S, TE>(
stream: S,
receiver: Receiver<OneshotDnsRequest>,
sender: BufDnsRequestStreamHandle,
) -> (Self, DnsExchangeBackground<S, TE>)
pub fn from_stream_with_receiver<S, TE>( stream: S, receiver: Receiver<OneshotDnsRequest>, sender: BufDnsRequestStreamHandle, ) -> (Self, DnsExchangeBackground<S, TE>)
Wraps a stream where a sender and receiver have already been established
Sourcepub fn connect<F, S, TE>(connect_future: F) -> DnsExchangeConnect<F, S, TE> ⓘwhere
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin,
TE: Time + Unpin,
pub fn connect<F, S, TE>(connect_future: F) -> DnsExchangeConnect<F, S, TE> ⓘwhere
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin,
TE: Time + Unpin,
Returns a future, which itself wraps a future which is awaiting connection.
The connect_future should be lazy.
Sourcepub fn error<F, S, TE>(error: ProtoError) -> DnsExchangeConnect<F, S, TE> ⓘwhere
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin,
TE: Time + Unpin,
pub fn error<F, S, TE>(error: ProtoError) -> DnsExchangeConnect<F, S, TE> ⓘwhere
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin,
TE: Time + Unpin,
Returns a future that returns an error immediately.
Trait Implementations§
Source§impl Clone for DnsExchange
impl Clone for DnsExchange
Source§impl DnsHandle for DnsExchange
impl DnsHandle for DnsExchange
Source§type Response = DnsExchangeSend
type Response = DnsExchangeSend
The associated response from the response stream, this should resolve to the Response messages
Source§fn send<R: Into<DnsRequest> + Unpin + Send + 'static>(
&self,
request: R,
) -> Self::Response
fn send<R: Into<DnsRequest> + Unpin + Send + 'static>( &self, request: R, ) -> Self::Response
Send a message via the channel in the client Read more
Source§fn is_verifying_dnssec(&self) -> bool
fn is_verifying_dnssec(&self) -> bool
Only returns true if and only if this DNS handle is validating DNSSEC. Read more
Source§fn is_using_edns(&self) -> bool
fn is_using_edns(&self) -> bool
Allow for disabling EDNS
Auto Trait Implementations§
impl Freeze for DnsExchange
impl !RefUnwindSafe for DnsExchange
impl Send for DnsExchange
impl Sync for DnsExchange
impl Unpin for DnsExchange
impl !UnwindSafe for DnsExchange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more