Struct trust_dns_client::client::AsyncClient [−][src]
A DNS Client implemented over futures-rs.
This Client is generic and capable of wrapping UDP, TCP, and other underlying DNS protocol implementations.
Implementations
impl AsyncClient<DnsMultiplexerSerialResponse>
[src]
pub fn new<F, S>(
stream: F,
stream_handle: Box<dyn DnsStreamHandle>,
signer: Option<Arc<Signer>>
) -> AsyncClientConnect<DnsMultiplexerConnect<F, S, Signer>, DnsMultiplexer<S, Signer>, DnsMultiplexerSerialResponse>ⓘNotable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
S: DnsClientStream + Unpin + 'static,
[src]
stream: F,
stream_handle: Box<dyn DnsStreamHandle>,
signer: Option<Arc<Signer>>
) -> AsyncClientConnect<DnsMultiplexerConnect<F, S, Signer>, DnsMultiplexer<S, Signer>, DnsMultiplexerSerialResponse>ⓘ
Notable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
S: DnsClientStream + Unpin + 'static,
Spawns a new AsyncClient Stream. This uses a default timeout of 5 seconds for all requests.
Arguments
stream
- A stream of bytes that can be used to send/receive DNS messages (see TcpClientStream or UdpClientStream)stream_handle
- The handle for thestream
on which bytes can be sent/received.signer
- An optional signer for requests, needed for Updates with Sig0, otherwise not needed
pub fn with_timeout<F, S>(
stream: F,
stream_handle: Box<dyn DnsStreamHandle>,
timeout_duration: Duration,
signer: Option<Arc<Signer>>
) -> AsyncClientConnect<DnsMultiplexerConnect<F, S, Signer>, DnsMultiplexer<S, Signer>, DnsMultiplexerSerialResponse>ⓘNotable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsClientStream + Unpin + 'static,
[src]
stream: F,
stream_handle: Box<dyn DnsStreamHandle>,
timeout_duration: Duration,
signer: Option<Arc<Signer>>
) -> AsyncClientConnect<DnsMultiplexerConnect<F, S, Signer>, DnsMultiplexer<S, Signer>, DnsMultiplexerSerialResponse>ⓘ
Notable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsClientStream + Unpin + 'static,
Spawns a new AsyncClient Stream.
Arguments
stream
- A stream of bytes that can be used to send/receive DNS messages (see TcpClientStream or UdpClientStream)timeout_duration
- All requests may fail due to lack of response, this is the time to wait for a response before canceling the request.stream_handle
- The handle for thestream
on which bytes can be sent/received.signer
- An optional signer for requests, needed for Updates with Sig0, otherwise not needed
impl<R> AsyncClient<R> where
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
[src]
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
pub fn connect<F, S>(connect_future: F) -> AsyncClientConnect<F, S, R>ⓘNotable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
where
S: DnsRequestSender<DnsResponseFuture = R>,
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
[src]
Notable traits for AsyncClientConnect<F, S, R>
impl<F, S, R> Future for AsyncClientConnect<F, S, R> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender<DnsResponseFuture = R> + 'static + Send + Unpin,
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin, type Output = Result<(AsyncClient<R>, DnsExchangeBackground<S, R, TokioTime>), ProtoError>;
S: DnsRequestSender<DnsResponseFuture = R>,
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
Returns a future, which itself wraps a future which is awaiting connection.
The connect_future should be lazy.
Returns
This returns a tuple of Self a handle to send dns messages and an optional background. The background task must be run on an executor before handle is used, if it is Some. If it is None, then another thread has already run the background.
Trait Implementations
impl<R> Clone for AsyncClient<R> where
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
[src]
R: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Resp> DnsHandle for AsyncClient<Resp> where
Resp: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
[src]
Resp: Future<Output = Result<DnsResponse, ProtoError>> + 'static + Send + Unpin,
type Response = DnsExchangeSend<Resp>
The associated response from the response future, this should resolve to the Response message
fn send<R: Into<DnsRequest> + Unpin + Send + 'static>(
&mut self,
request: R
) -> Self::Response
[src]
&mut self,
request: R
) -> Self::Response
pub fn is_verifying_dnssec(&self) -> bool
[src]
pub fn lookup(
&mut self,
query: Query,
options: DnsRequestOptions
) -> Self::Response
[src]
&mut self,
query: Query,
options: DnsRequestOptions
) -> Self::Response
Auto Trait Implementations
impl<R> !RefUnwindSafe for AsyncClient<R>
impl<R> Send for AsyncClient<R>
impl<R> Sync for AsyncClient<R>
impl<R> Unpin for AsyncClient<R>
impl<R> !UnwindSafe for AsyncClient<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,