| Crates.io | yo_netwatch |
| lib.rs | yo_netwatch |
| version | 0.1.5 |
| created_at | 2025-05-21 06:47:39.877408+00 |
| updated_at | 2025-06-10 13:15:26.760288+00 |
| description | A reactive network status monitor for egui apps. Inspired by Flutter's connectivity_plus, built with Rust by Yo (Yogi). |
| homepage | https://github.com/yogithesymbian/yo_netwatch |
| repository | https://github.com/yogithesymbian/yo_netwatch |
| max_upload_size | |
| id | 1682989 |
| size | 815,836 |

📡 A reactive internet connection status checker for egui apps — inspired by Flutter's connectivity_plus, built with ❤️ in Rust by Yo.
TcpStream pingegui via crossbeam-channeleframecargo install yo_netwatch
use yo_netwatch::start_network_watcher;
let rx = start_network_watcher();
if let Ok(online) = rx.recv() {
println!("Status jaringan: {}", if online { "Online ✅" } else { "Offline ❌" });
}
use eframe::egui;
use yo_netwatch::{start_network_watcher, Receiver};
fn main() -> Result<(), eframe::Error> {
eframe::run_native(
"Network Status App",
eframe::NativeOptions::default(),
Box::new(|_| Box::new(MyApp::new())),
)
}
struct MyApp {
connected: bool,
rx: Receiver<bool>,
}
impl MyApp {
fn new() -> Self {
let rx = start_network_watcher();
Self {
connected: false,
rx,
}
}
}
impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) {
while let Ok(status) = self.rx.try_recv() {
self.connected = status;
}
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("📡 Internet Status:");
ui.label(if self.connected {
"✅ Online"
} else {
"❌ Offline"
});
});
ctx.request_repaint_after(std::time::Duration::from_millis(100));
}
}