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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! The official Rust client library for the [InternetData](https://internetdata.io)
//! API: the licensed IP intelligence databases, their metadata and their
//! checksums.
//!
//! Start with [`Client::builder`] and an API key carrying the `db.download`
//! scope. Every database published today is licensed, so a keyless client is
//! answered `401` - the key is nevertheless OPTIONAL, and a client built without
//! one sends no `Authorization` header at all. There is no per-address lookup
//! here: the database catalog and the files behind it are reached through
//! [`Client::database`], and the OAuth sign-in, by device flow or by
//! authorization code, through [`Client::oauth`].
//!
//! ```no_run
//! # async fn run() -> Result<(), internetdata::Error> {
//! let client = internetdata::Client::builder().api_key("your-api-key").build()?;
//!
//! for database in client.database().list().await? {
//! println!("{}: {}", database.base, database.standing);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Async only
//!
//! Everything here is `async` on tokio, and there is no blocking facade.
//! `reqwest::blocking` builds its own runtime and PANICS when constructed inside
//! one, so a facade would fail for exactly the callers most likely to reach for
//! it. A caller with no runtime writes the three lines that make the cost
//! visible:
//!
//! ```no_run
//! # fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let runtime = tokio::runtime::Runtime::new()?;
//! let client = internetdata::Client::builder().api_key("your-api-key").build()?;
//! let databases = runtime.block_on(client.database().list())?;
//! # let _ = databases;
//! # Ok(())
//! # }
//! ```
// The OAuth unit tests reuse the integration suite's stub, which names this
// crate from outside.
extern crate self as internetdata;
pub use ;
pub use DatabaseApi;
pub use ;
pub use ;
use models;
// The v2 wire types, re-exported from the generated models so a consumer never
// names the module path.
pub use LicenseType;
pub use Outcome;
pub use ;
pub use ;