Skip to main content

Crate rfham_core

Crate rfham_core 

Source
Expand description

Core data types for RF-Ham libraries.

rfham-core provides foundational types shared across all crates in the rust-rfham ecosystem: callsign parsing, frequency and power measurements, country codes, regulatory agencies, and string-typed identifiers.

§Type overview

ModuleKey typesPurpose
[callsign][callsign::CallSign]ITU-format amateur radio callsigns
[frequency]Frequency, [frequency::Wavelength], [frequency::FrequencyRange]RF frequency values and ranges
powerPowerTransmit / receive power levels
[country]CountryCodeISO 3166-1 alpha-2 country codes
[agency]AgencyRegulatory and standards bodies
[id]Name, [id::DisplayName], [id::Tag]Validated string identifiers
fmtfmt::FormatterCustom formatting trait
[conversions][conversions::LengthInFeet]Imperial length representation

§Quick start

use rfham_core::{
    callsign::CallSign,
    Frequency,
    Power,
};

let callsign: CallSign = "K7SKJ/M".parse().unwrap();
assert_eq!(callsign.prefix(), "K");
assert!(callsign.is_mobile());

let freq = Frequency::megahertz(146.52);
let power = Power::watts(5.0);
println!("{callsign} on {freq} at {power}");

§Features

  • std (default): enables std-backed dependencies (I/O errors, LazyLock, etc.). Disable for no_std + alloc environments.

Re-exports§

pub use agencies::Agency;
pub use countries::CountryCode;
pub use frequencies::Frequency;
pub use names::Name;
pub use power::Power;

Modules§

agencies
Regulatory, standards-setting, and maintaining agencies.
callsigns
Amateur radio callsign parsing and validation.
countries
ISO 3166-1 alpha-2 country codes.
error
Error and result types for rfham-core.
fmt
Custom formatting trait for rfham types.
frequencies
RF frequency, wavelength, and frequency-range types.
names
Validated string identifier types and the StringLike trait.
non_si
Unit conversion helpers for ham-radio measurements.
power
Transmit / receive power type.

Macros§

name_fn