Skip to main content

Crate hamcty

Crate hamcty 

Source
Expand description

Load and search in a CTY database

licensed under CC BY-SA 4.0, To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/

Author: Andreas, df1asc@darc.de

§Example

use hamcty::{CountryDatabase, CtyType, load_recent_cty};

fn main() {
    // Use crate internal data (maybe not up to date)...
    let cdb = CountryDatabase::new();
    // ...or load recent CTY and load data from path (you decide about the version)
    load_recent_cty("cty.csv", CtyType::Cty).expect("Could not load recent CTY");
    let cdb = CountryDatabase::from_path("cty.csv").expect("Could not load cty data");

    let call = "DF1ASC";
    assert_eq!(cdb.country(call).unwrap().code, "DL");
    assert_eq!(cdb.prefix(call), Ok("DF".to_string()));
 }

Modules§

error

Structs§

Country
Holds a country information set
CountryDatabase
Holds the complete country database
Location
Coordinates for a location

Enums§

Continent
Continents

Constants§

NAME
VERSION

Type Aliases§

CQZone
CQ zone number
CountryCode
Ham radio country code
CountryMap
Maps the Ham radio country code to the country information
DXCCEntity
DXCC entity code
ITUZone
ITU zone number
TimeOffset
UTC time offset