Skip to main content

ndt7_client/
lib.rs

1//! An [ndt7](https://github.com/m-lab/ndt-server/blob/master/spec/ndt7-protocol.md) speed test
2//! client library.
3//!
4//! ndt7 is a network performance measurement protocol developed by
5//! [M-Lab](https://www.measurementlab.net/). It measures download and upload throughput
6//! over WebSocket connections and reports TCP-level metrics such as latency and retransmission.
7//!
8//! # Quick start
9//!
10//! ```no_run
11//! use ndt7_client::client::ClientBuilder;
12//!
13//! # #[tokio::main]
14//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
15//! let client = ClientBuilder::new("my-app", "0.1.0").build();
16//! let targets = client.locate_test_targets().await?;
17//!
18//! if let Some(url) = &targets.download_url {
19//!     let mut rx = client.start_download(url).await?;
20//!     while let Some(result) = rx.recv().await {
21//!         match result {
22//!             Ok(m) => println!("{:?}", m),
23//!             Err(e) => eprintln!("error: {e}"),
24//!         }
25//!     }
26//! }
27//! # Ok(())
28//! # }
29//! ```
30
31#![warn(missing_docs)]
32
33pub mod client;
34pub mod download;
35pub mod emitter;
36pub mod error;
37pub mod locate;
38pub mod params;
39pub mod spec;
40pub mod summary;
41pub mod upload;