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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//! # OpenSky Network API
//! This is a Rust library for interacting with the OpenSky Network API.
//! The OpenSky Network is a community-based receiver network which continuously
//! collects air traffic surveillance data. Unlike other networks, OpenSky keeps
//! the collected data forever and makes it available to researchers and
//! developers. The OpenSky Network API provides a way to access the collected
//! data.
//!
//! Please follow [The OpenSky Network API documentation](https://openskynetwork.github.io/opensky-api/) for more information.
//!
//! ## Example
//!
//! Get the state vectors of aircraft.
//! ```rust
//! use opensky_network::OpenSkyApi;
//! #[tokio::main]
//! async fn main() {
//! let api = OpenSkyApi::new();
//! let request = api
//! .get_states()
//! .at_time(1458564121)
//! .with_icao24("3c6444".to_string());
//! let result = request.send().await.expect("Failed to get states");
//! println!("{:#?}", result);
//! }
//! ```
//!
//! Get the flight data of aircraft.
//! ```rust
//! use opensky_network::OpenSkyApi;
//! use std::env;
//! #[tokio::main]
//! async fn main() {
//! dotenv::dotenv().ok();
//! // setup OPENSKY_USER and OPENSKY_PASS in .env file
//! let username = env::var("OPENSKY_USER").expect("OPENSKY_USER environment variable not set");
//! let password = env::var("OPENSKY_PASS").expect("OPENSKY_PASS environment variable not set");
//! let api = OpenSkyApi::with_login(username, password);
//!
//! let now = std::time::SystemTime::now()
//! .duration_since(std::time::UNIX_EPOCH)
//! .unwrap()
//! .as_secs();
//! let mut request = api.get_flights(now - 7 * 24 * 60 * 60, now);
//! request.by_aircraft("8990ed".to_string());
//! let result = request.send().await.expect("Failed to get flights");
//! println!("{:#?}", result);
//! }
//! ```
use Arc;
pub use BoundingBox;
pub use Flight;
use FlightsRequestBuilder;
use StateRequestBuilder;
pub use ;
use TrackRequestBuilder;
pub use ;
/// The OpenSky Network API <https://openskynetwork.github.io/opensky-api>