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
//! # Synapse
//!
//! Standardized network-quality metrics beyond raw speed tests.
//!
//! Synapse turns caller-supplied measurements into three scores:
//!
//! - **Vortex** — performance / flow (throughput, latency, jitter, loss)
//! - **Radiance** — wireless physical quality (SNR × channel width)
//! - **Axon** — unified health (`√(Vortex × Radiance)`, or Vortex alone on wired links)
//!
//! This crate does **not** run speed tests or probe the network. You collect
//! the numbers; Synapse scores them.
//!
//! # Quick start
//!
//! ```
//! use synapse_rs::{NetworkData, ScoreBand};
//!
//! let data = NetworkData::new()
//! .with_down_mbps(150.0)
//! .with_up_mbps(40.0)
//! .with_ping_ms(18.0)
//! .with_jitter_ms(2.0)
//! .with_packet_loss_percent(0.0)
//! .with_rssi_dbm(-60.0)
//! .with_noise_dbm(-90.0)
//! .with_channel_width_mhz(40.0);
//!
//! let axon = data.calculate_axon().expect("valid sample");
//! let band = ScoreBand::from_score(axon);
//! assert!(axon.is_finite());
//! assert_ne!(band.as_str(), "");
//! ```
//!
//! # Fallible API
//!
//! Prefer `try_*` when you need to distinguish missing fields from invalid
//! values (`NaN`, negative speeds, RSSI below noise, …):
//!
//! ```
//! use synapse_rs::{NetworkData, SynapseError};
//!
//! let data = NetworkData::new().with_down_mbps(-1.0);
//! assert!(matches!(
//! data.try_vortex(),
//! Err(SynapseError::MissingField(_)) | Err(SynapseError::InvalidValue { .. })
//! ));
//! ```
//!
//! # Feature flags
//!
//! - `serde` — derive `Serialize` / `Deserialize` on public types
pub use ;
pub use ;