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§
Sourcetype Conn: DnsHandle + Clone + Send + Sync + 'static
type Conn: DnsHandle + Clone + Send + Sync + 'static
The handle to the connection for sending DNS requests.
Sourcetype FutureConn: Future<Output = Result<Self::Conn, ProtoError>> + Send + 'static
type FutureConn: Future<Output = Result<Self::Conn, ProtoError>> + 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,
) -> Result<Self::FutureConn, Error>
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.