Trait trust_dns_resolver::ConnectionProvider[][src]

pub trait ConnectionProvider: 'static + Clone + Send + Sync + Unpin {
    type Conn: DnsHandle<Error = ResolveError> + Clone + Send + Sync + 'static;
    type FutureConn: Future<Output = Result<Self::Conn, ResolveError>> + Send + 'static;
    type Time: Time;
    fn new_connection(
        &self,
        config: &NameServerConfig,
        options: &ResolverOpts
    ) -> Self::FutureConn; }

A type to allow for custom ConnectionProviders. Needed mainly for mocking purposes.

ConnectionProvider is responsible for spawning any background tasks as necessary.

Associated Types

type Conn: DnsHandle<Error = ResolveError> + Clone + Send + Sync + 'static[src]

The handle to the connect for sending DNS requests.

type FutureConn: Future<Output = Result<Self::Conn, ResolveError>> + Send + 'static[src]

Ths future is responsible for spawning any background tasks as necessary

type Time: Time[src]

The type used to set up timeout futures

Loading content...

Required methods

fn new_connection(
    &self,
    config: &NameServerConfig,
    options: &ResolverOpts
) -> Self::FutureConn
[src]

The returned handle should

Loading content...

Implementors

Loading content...