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
| Module | Key types | Purpose |
|---|---|---|
[callsign] | [callsign::CallSign] | ITU-format amateur radio callsigns |
[frequency] | Frequency, [frequency::Wavelength], [frequency::FrequencyRange] | RF frequency values and ranges |
power | Power | Transmit / receive power levels |
[country] | CountryCode | ISO 3166-1 alpha-2 country codes |
[agency] | Agency | Regulatory and standards bodies |
[id] | Name, [id::DisplayName], [id::Tag] | Validated string identifiers |
fmt | fmt::Formatter | Custom 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): enablesstd-backed dependencies (I/O errors,LazyLock, etc.). Disable forno_std+allocenvironments.
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
StringLiketrait. - non_si
- Unit conversion helpers for ham-radio measurements.
- power
- Transmit / receive power type.