Module adsbx_json::v2
source · Expand description
Parses version 2 of the ADS-B Exchange API JSON format.
use adsbx_json::v2::Response;
use std::str::FromStr;
let response = Response::from_str(&json_str).unwrap();
println!("Got {} aircraft", response.aircraft.len());
let ac = &response.aircraft[0];
println!("ICAO: {}", ac.hex);
if let Some(reg) = &ac.registration {
println!("Registration: {}", reg);
}
if let (Some(lat), Some(lon)) = (ac.lat, ac.lon) {
println!("Aircraft is at {}, {}", lat, lon);
}
Structs§
- An aircraft. (Might not actually be an aircraft—could be a ground vehicle, or a test beacon.)
- Flags an aircraft may have in the ADS-B Exchange database.
- The ADS-B Exchange API response. This has most of the info you want :)
Enums§
- Describes the status of an aircraft, either airborne or on the ground.
- Describes the source of a message.