Struct trust_dns_client::client::AsyncClient [−][src]
pub struct AsyncClient { /* fields omitted */ }
Expand description
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
[src]
impl AsyncClient
[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>>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
S: DnsClientStream + Unpin + 'static,
[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>>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
S: DnsClientStream + Unpin + 'static,
[src]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>>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsClientStream + Unpin + 'static,
[src]
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>>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsClientStream + Unpin + 'static,
[src]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 AsyncClient
[src]
impl AsyncClient
[src]pub fn connect<F, S>(connect_future: F) -> AsyncClientConnect<F, S>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
S: DnsRequestSender,
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
[src]
pub fn connect<F, S>(connect_future: F) -> AsyncClientConnect<F, S>ⓘNotable traits for AsyncClientConnect<F, S>
impl<F, S> Future for AsyncClientConnect<F, S> where
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
S: DnsRequestSender + 'static + Send + Unpin, type Output = Result<(AsyncClient, DnsExchangeBackground<S, TokioTime>), ProtoError>;
where
S: DnsRequestSender,
F: Future<Output = Result<S, ProtoError>> + 'static + Send + Unpin,
[src]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 Clone for AsyncClient
[src]
impl Clone for AsyncClient
[src]impl DnsHandle for AsyncClient
[src]
impl DnsHandle for AsyncClient
[src]type Response = DnsExchangeSend
type Response = DnsExchangeSend
The associated response from the response future, this should resolve to the Response message
type Error = ProtoError
type Error = ProtoError
Error of the response, generally this will be ProtoError
fn send<R: Into<DnsRequest> + Unpin + Send + 'static>(
&mut self,
request: R
) -> Self::Response
[src]
fn send<R: Into<DnsRequest> + Unpin + Send + 'static>(
&mut self,
request: R
) -> Self::Response
[src]Send a message via the channel in the client Read more
fn is_verifying_dnssec(&self) -> bool
[src]
fn is_verifying_dnssec(&self) -> bool
[src]Only returns true if and only if this DNS handle is validating DNSSec. Read more
Auto Trait Implementations
impl !RefUnwindSafe for AsyncClient
impl Send for AsyncClient
impl Sync for AsyncClient
impl Unpin for AsyncClient
impl !UnwindSafe for AsyncClient
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,