Struct oldnav_lib::navdata::database::Database [] [src]

pub struct Database {
    pub fixes: Vec<Rc<Waypoint>>,
    pub waypoint_hash: MultiHash<StringRc<Waypoint>>,
    pub countries: HashMap<StringRc<Country>>,
    pub airways: HashMap<StringRc<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<StringRc<Waypoint>>

hash of waypoints associated with their names

countries: HashMap<StringRc<Country>>

note: if I want to make waypoint mutable, or country mutable, I may need to put them in a Rc>.

pub airports: Vec>, pub waypoints: MultiHash, Where all the countries are stored in the database

airways: HashMap<StringRc<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

Trait Implementations

impl Debug for Database
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.