1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! # ddg: A DuckDuckGo Instant Answers wrapper library.
//!
//! This library provides a strongly typed wrapper around the DuckDuckGo Instant
//! Answers API. Most of the documentation comes from the
//! [DuckDuckGo Instant Answers API Documentation](https://duckduckgo.com/api)
//! This library comes with reqwest by default for convenience, however it can be
//! disabled. If disabled the library will fallback to hyper for `IntoUrl` so it
//! can be used with your own hyper client implementation.
//!
//! ### Example
//!
//! ```
//! use ddg::Query;
//! const APP_NAME: &'static str = "ddg_example_app";
//! // Search for Rust and we want to strip out any HTML content in the answers.
//! let query = Query::new("Rust", APP_NAME).no_html();
//!
//! let response = query.execute().unwrap();
//!
//! println!("{:?}", response);
//! ```

#![deny(missing_docs)]

#[cfg(feature = "reqwest")] extern crate reqwest;
#[cfg(feature = "hyper")] extern crate hyper;
extern crate serde;
extern crate serde_json;

/// The Query struct, and it's Error struct.
pub mod query;
/// The DdgResponse, and all the related types.
pub mod ddg_response {
    include!(concat!(env!("OUT_DIR"), "/serde_types.rs"));
}

pub use query::Query;
pub use ddg_response::DdgResponse;