1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! # netspeed-cli
//!
//! A command-line internet bandwidth tester using speedtest.net servers.
//!
//! ## Overview
//!
//! This crate provides both a library and a binary (`netspeed-cli`) for
//! measuring download speed, upload speed, latency, jitter, and latency
//! under load. It connects to speedtest.net's server infrastructure to
//! perform real-world bandwidth tests.
//!
//! ## Key Features
//!
//! - **Multi-format output**: dashboard, detailed, compact, simple, minimal, JSON, JSONL, CSV
//! - **Theming**: dark, light, high-contrast, monochrome with `NO_COLOR` support
//! - **User profiles**: gamer, streamer, remote-worker, power-user, casual
//! - **Quality grading**: A–F ratings for each metric and an overall score
//! - **Latency under load**: measures ping degradation during bandwidth saturation
//! - **Test history**: persistent local storage with backup and corruption recovery
//! - **TLS options**: custom CA certs, domain-restricted TLS, configurable TLS version
//!
//! ## Modules
//!
//! - [`bandwidth_loop`] — Inner bandwidth measurement loop with live progress
//! - [`bin_errors`] — Binary-level error handling and exit codes
//! - [`cli`] — Command-line argument parsing with clap
//! - [`common`] — Shared utilities (bandwidth calculation, formatting, validation)
//! - [`config`] — Configuration management (CLI args + config file)
//! - [`domain`] — Core business logic (measurement, reporting, server, speedtest)
//! - [`download`] — Multi-stream download bandwidth measurement
//! - [`endpoints`] — Canonical speedtest endpoint derivation
//! - [`error`] — Unified error types with categorization
//! - [`formatter`] — Output formatting (dashboard, detailed, compact, simple, JSON, CSV)
//! - [`grades`] — Quality grade system (A–F ratings)
//! - [`history`] — Persistent test result history with sparkline trends
//! - [`http`] — HTTP client creation and IP discovery
//! - [`http_client`] — Typed HTTP client abstraction
//! - [`logging`] — Structured JSON logging
//! - [`orchestrator`] — Top-level test orchestration and service wiring
//! - [`output`] — Output dispatch and rendering
//! - [`output_strategy`] — Format resolution from config and flags
//! - [`phase_registry`] — Phase registration and lookup
//! - [`phase_runner`] — Phase execution with template method pattern
//! - [`phases`] — Phase context and executor definitions
//! - [`profiles`] — User profiles/roles (gamer, streamer, etc.)
//! - [`progress`] — Terminal progress bars, spinners, and sparklines
//! - [`result_processor`] — Result aggregation and processing
//! - [`servers`] — Server discovery, distance calculation, and selection
//! - [`services`] — Service container for dependency injection
//! - [`storage`] — Abstract storage trait for test results
//! - [`task_runner`] — Test orchestration with retry and timeout
//! - [`terminal`] — Terminal capability detection (color, animation, width)
//! - [`test_config`] — Per-test configuration (retries, stream count)
//! - [`theme`] — Color theming (Dark, Light, HighContrast, Monochrome)
//! - [`types`] — Shared data structures (Server, TestResult, etc.)
//! - [`upload`] — Multi-stream upload bandwidth measurement
// Pedantic lints allowed at crate level — too noisy for a CLI bandwidth tester.
// Individual modules may re-enable specific lints where stricter checking is desired.