Trait trust_dns_resolver::ConnectionProvider [−][src]
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;
fn new_connection(
&self,
config: &NameServerConfig,
options: &ResolverOpts
) -> Self::FutureConn;
}
Expand description
A type to allow for custom ConnectionProviders. Needed mainly for mocking purposes.
ConnectionProvider is responsible for spawning any background tasks as necessary.
Associated Types
The handle to the connect for sending DNS requests.
type 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
Required methods
fn new_connection(
&self,
config: &NameServerConfig,
options: &ResolverOpts
) -> Self::FutureConn
fn new_connection(
&self,
config: &NameServerConfig,
options: &ResolverOpts
) -> Self::FutureConn
The returned handle should