Struct oldnav_lib::navdata::database::Database
[−]
[src]
pub struct Database { pub fixes: Vec<Rc<Waypoint>>, pub waypoint_hash: MultiHash<String, Rc<Waypoint>>, pub countries: HashMap<String, Rc<Country>>, pub airways: HashMap<String, Rc<Route>>, pub cycle_info: CycleInfo, }
A navigation database
Fields
fixes: Vec<Rc<Waypoint>>
Where all the fixes are stored in the database
waypoint_hash: MultiHash<String, Rc<Waypoint>>
hash of waypoints associated with their names
countries: HashMap<String, Rc<Country>>
note: if I want to make waypoint mutable, or country mutable,
I may need to put them in a Rc
pub airports: Vec
airways: HashMap<String, Rc<Route>>
Where all the airways are stored in the database
cycle_info: CycleInfo
Information about the current AIRAC cycle loaded into this navigation database.
Methods
impl Database
[src]
fn new(navdata_dir: PathBuf, resources_dir: PathBuf) -> Database
Constructor for Database
fn insert_fix(&mut self, waypoint: Waypoint)
Insert a fix waypoint into this database.
fn match_waypoint_dist(&self, code: &str, position: &SphericalCoordinate, max_dist: f64) -> Option<&Rc<Waypoint>>
Find a waypoint which most closely matches the supplied parameters. + code: the icao code for the waypoint + position and max_dist: max distance of the waypoint from the given position