Struct DnsExchange
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§
§impl DnsExchange
impl DnsExchange
pub fn from_stream<S, TE>(
stream: S,
) -> (DnsExchange, DnsExchangeBackground<S, TE>)
pub fn from_stream<S, TE>( stream: S, ) -> (DnsExchange, 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
pub fn from_stream_with_receiver<S, TE>(
stream: S,
receiver: Receiver<OneshotDnsRequest>,
sender: BufDnsRequestStreamHandle,
) -> (DnsExchange, DnsExchangeBackground<S, TE>)
pub fn from_stream_with_receiver<S, TE>( stream: S, receiver: Receiver<OneshotDnsRequest>, sender: BufDnsRequestStreamHandle, ) -> (DnsExchange, DnsExchangeBackground<S, TE>)
Wraps a stream where a sender and receiver have already been established
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,
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.
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,
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§
§impl Clone for DnsExchange
impl Clone for DnsExchange
§fn clone(&self) -> DnsExchange
fn clone(&self) -> DnsExchange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§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
§fn send<R>(&self, request: R) -> <DnsExchange as DnsHandle>::Response
fn send<R>(&self, request: R) -> <DnsExchange as DnsHandle>::Response
Send a message via the channel in the client Read more
§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
§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more