Expand description
Rust interface for handling OurAirports data.
§Examples
Retrieving airport data
use ourairports::airports::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let airports = get_airports_csv()?;
// London Heathrow Airport (ICAO: EGLL, IATA: LHR)
let heathrow_airport = airports.get(&2434).unwrap();
assert_eq!(2434, heathrow_airport.id());
assert_eq!("EGLL", heathrow_airport.ident());
assert_eq!("LHR", heathrow_airport.iata_code());
assert_eq!(&AirportType::LargeAirport, heathrow_airport.airport_type());
Ok(())
}§Credits
The descriptions for many of the fields and enum variants is adapted from the OurAirports data dictionary and map legend.
Modules§
- airport_
frequencies - Contains the type representing a single radio frequency.
- airports
- Contains the type representing a single airport as well as enums of possible airport types.
- countries
- Contains the type representing a single country.
- navaids
- Contains the type representing a single radio navigation as well as enums of possible radio navigation types, power and usage type.
- regions
- Contains the type representing a single administrative subdivision.
- runways
- Contains the type representing a single radio frequency.
Enums§
- Continent
- List of allowed continent values.
- Fetch
Error - Error type for errors in fetching OurAirports data (e.g.
airports::get_airports_csv())
Traits§
- ToJson
String - Trait for converting OurAirports data into JSON string.
Type Aliases§
- Id
- Type of all ID fields.