hyper_system_resolver/lib.rs
1//! System DNS resolver for [`hyper`].
2//!
3//! Resolves the name via `getaddrinfo`, but more flexible than [`hyper`]
4//! standard resolver.
5//!
6//! ## Usage
7//!
8//! ```
9//! # #[cfg(feature = "addr-info-hints")] {
10//! use hyper_system_resolver::{addr_info_hints, AddrInfoHints};
11//!
12//! let addr_info_hints = AddrInfoHints {
13//! address_family: addr_info_hints::AddressFamily::Inet6,
14//! };
15//! let system_resolve = hyper_system_resolver::system::System {
16//! addr_info_hints: Some(addr_info_hints.into()),
17//! service: None,
18//! };
19//! let http_connector = hyper::client::HttpConnector::new_with_resolver(system_resolve.resolver());
20//! let client = hyper::client::Client::builder().build::<_, hyper::Body>(http_connector);
21//! # }
22//! ```
23
24#![warn(missing_docs, clippy::all)]
25
26#[macro_use]
27extern crate tracing;
28
29#[macro_use]
30extern crate derive_builder;
31
32#[cfg(feature = "addr-info-hints")]
33pub mod addr_info_hints;
34pub mod background;
35pub mod system;
36
37#[cfg(feature = "addr-info-hints")]
38pub use addr_info_hints::AddrInfoHints;