Skip to main content

ns_env_config/
lib.rs

1//! The name resolution configured via environment variable.
2//!
3//! [API Docs](https://docs.rs/ns-env-config) |
4//! [Usage](https://github.com/tailhook/ns-env-config#usage) |
5//! [Github](https://github.com/tailhook/ns-env-config) |
6//! [Crate](https://crates.io/crates/ns-env-config)
7//!
8//! This crate also re-exports important things from abstract-ns and router so
9//! that you don't have to track too many dependencies.
10//!
11//! # Example
12//!
13//! ```
14//! extern crate ns_env_config;
15//! extern crate tokio_core;
16//! use tokio_core::reactor::Core;
17//!
18//! fn main() {
19//!     let mut core = Core::new().expect("reactor init");
20//!     let ns = ns_env_config::init(&core.handle()).expect("name system init");
21//!     let addr = core.run(ns.resolve_auto("localhost", 80)).unwrap();
22//!     println!("Localhost HTTP is {:?}", addr);
23//! }
24//! ```
25//!
26#![warn(missing_docs)]
27#![warn(missing_debug_implementations)]
28
29pub extern crate abstract_ns as ns;
30pub extern crate ns_router as router;
31
32extern crate failure;
33extern crate futures_cpupool;
34extern crate ns_std_threaded;
35extern crate tokio_core;
36extern crate void;
37
38mod initialize;
39pub mod config;
40
41pub use ns::{Address, IpList, Error};
42pub use router::{Router};
43pub use initialize::{init, init_default, force_config};