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 RuntimeProvider: RuntimeProvider;
// Required method
fn new_connection(
&self,
config: &NameServerConfig,
options: &ResolverOpts
) -> Self::FutureConn;
}
Expand description
Create DnsHandle
with the help of RuntimeProvider
.
This trait is designed for customization.
Required Associated Types§
sourcetype Conn: DnsHandle<Error = ResolveError> + Clone + Send + Sync + 'static
type Conn: DnsHandle<Error = ResolveError> + Clone + Send + Sync + 'static
The handle to the connect for sending DNS requests.
sourcetype FutureConn: Future<Output = Result<Self::Conn, ResolveError>> + Send + 'static
type FutureConn: Future<Output = Result<Self::Conn, ResolveError>> + Send + 'static
Ths future is responsible for spawning any background tasks as necessary.
sourcetype RuntimeProvider: RuntimeProvider
type RuntimeProvider: RuntimeProvider
Provider that handles the underlying I/O and timing.
Required Methods§
sourcefn new_connection(
&self,
config: &NameServerConfig,
options: &ResolverOpts
) -> Self::FutureConn
fn new_connection( &self, config: &NameServerConfig, options: &ResolverOpts ) -> Self::FutureConn
Create a new connection.
Object Safety§
This trait is not object safe.