Struct hickory_proto::xfer::DnsExchange
source · 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
§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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)