Skip to main content

qso_graph_trust/
lib.rs

1// SPDX-License-Identifier: GPL-3.0-or-later
2// Copyright (C) 2026 the QSO Graph Trust contributors (see AUTHORS). Part of QSO Graph Trust; see LICENSE.
3
4#![doc = include_str!("../README.md")]
5#![forbid(unsafe_code)]
6#![warn(missing_docs)]
7
8pub mod certificate;
9pub mod export;
10pub mod files;
11// gzip is public for this repository's own tests, which edit TQSL backups; it is not part of the
12// API and may change in any release.
13#[doc(hidden)]
14pub mod gzip;
15pub mod import;
16mod lotw;
17mod memory;
18pub mod options;
19mod pkcs12;
20mod protected_key;
21pub mod qso;
22pub mod records;
23pub mod request;
24pub mod signed_log;
25pub mod signing;
26pub mod station;
27pub mod store;
28pub mod tbk;
29pub mod tqsl_locations;
30pub mod upload;
31mod xml;
32
33/// This library's version, as Cargo has it.
34pub const VERSION: &str = env!("CARGO_PKG_VERSION");
35
36#[cfg(test)]
37mod tests {
38    use super::VERSION;
39
40    #[test]
41    fn version_is_semantic() {
42        // MAJOR.MINOR.PATCH, or a beta of one: MAJOR.MINOR.PATCH-beta.N.
43        let (release, beta) = match VERSION.split_once('-') {
44            Some((release, pre)) => (release, Some(pre)),
45            None => (VERSION, None),
46        };
47        let parts: Vec<&str> = release.split('.').collect();
48        assert_eq!(parts.len(), 3, "{VERSION}");
49        assert!(parts.iter().all(|p| p.parse::<u32>().is_ok()), "{VERSION}");
50        if let Some(pre) = beta {
51            let n = pre.strip_prefix("beta.").expect(VERSION);
52            assert!(n.parse::<u32>().is_ok_and(|n| n > 0), "{VERSION}");
53        }
54    }
55}
56
57mod adx;
58mod cabrillo;
59mod cabrillo_tables;