hickory_resolver::name_server

Trait ConnectionProvider

Source
pub trait ConnectionProvider:
    'static
    + Clone
    + Send
    + Sync
    + Unpin {
    type Conn: DnsHandle + Clone + Send + Sync + 'static;
    type FutureConn: Future<Output = Result<Self::Conn, ProtoError>> + Send + 'static;
    type RuntimeProvider: RuntimeProvider;

    // Required method
    fn new_connection(
        &self,
        config: &NameServerConfig,
        options: &ResolverOpts,
    ) -> Result<Self::FutureConn, Error>;
}
Expand description

Create DnsHandle with the help of RuntimeProvider. This trait is designed for customization.

Required Associated Types§

Source

type Conn: DnsHandle + Clone + Send + Sync + 'static

The handle to the connection for sending DNS requests.

Source

type FutureConn: Future<Output = Result<Self::Conn, ProtoError>> + Send + 'static

Ths future is responsible for spawning any background tasks as necessary.

Source

type RuntimeProvider: RuntimeProvider

Provider that handles the underlying I/O and timing.

Required Methods§

Source

fn new_connection( &self, config: &NameServerConfig, options: &ResolverOpts, ) -> Result<Self::FutureConn, Error>

Create a new connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§