Skip to main content

Crate netrunner_core

Crate netrunner_core 

Source
Expand description

§netrunner-core

Framework-free internet speed-test and network-diagnostics engine shared by the netrunner_cli (Ratatui TUI) and netrunner (Zed GPUI desktop) apps, and usable as a standalone library.

ModuleWhat lives here
typesDomain models — results, servers, config, quality ratings, diagnostics
speed_testGeolocation, server discovery/selection, throughput & latency measurement (SpeedTest)
diagnosticsGateway/DNS/route/IPv6 network diagnostics (NetworkDiagnosticsTool)
historyEmbedded redb history storage & statistics (HistoryStorage)
eventsUI-agnostic progress events (TestEvent) streamed over a channel

This crate has no GUI or TUI dependencies. Progress is reported through TestEvents so any front-end can render it.

§Quick start

use netrunner_core::{SpeedTest, TestConfig};

let test = SpeedTest::new(TestConfig::default())?;
let result = test.run_full_test().await?;
println!("{:.1} Mbps down / {:.1} Mbps up", result.download_mbps, result.upload_mbps);

Re-exports§

pub use diagnostics::NetworkDiagnosticsTool;
pub use events::emit;
pub use events::EventSender;
pub use events::Phase;
pub use events::SelectedServer;
pub use events::TestEvent;
pub use history::DbStats;
pub use history::HistoryStorage;
pub use history::SpeedTrends;
pub use history::TestStatistics;
pub use presentation::palette;
pub use presentation::quality_rgb;
pub use settings::Settings;
pub use speed_test::GeoLocation;
pub use speed_test::SpeedTest;
pub use types::ConnectionQuality;
pub use types::DetailLevel;
pub use types::NetworkDiagnostics;
pub use types::RouteHop;
pub use types::ServerCapabilities;
pub use types::ServerProvider;
pub use types::SpeedTestResult;
pub use types::TestConfig;
pub use types::TestServer;

Modules§

diagnostics
Network diagnostics engine (UI-agnostic).
events
UI-agnostic progress events emitted by the speed-test and diagnostics engines.
history
History Storage - Using Redb Embedded Database
presentation
Shared, UI-agnostic presentation helpers.
settings
User settings, persisted as human-editable JSON.
speed_test
Speed Test Module
types

Macros§

quality_color_fn
Generate a function mapping ConnectionQuality to a front-end colour type.