online

📶 Library to check your Internet connectivity

Logo

Workflow status Latest version

Features

How it works

Install

The library is available on crates.io. Simply add the next line to your project's Cargo.toml.

toml online = "3.0.1"

Synchronous

The async-std runtime is supported by default. But you can explicitly choose the blocking alternative.

toml online = { version = "3.0.1", default-features = false, features = ["sync"] }

Use

📝 Please visit the examples and the full documentation if you want to learn the details.

```rust use online::check;

[async_std::main]

async fn main() { println!("Online? {}", check(None).await.isok()); println!("Online (timeout)? {}", check(Some(5)).await.isok()); println!("Online (Result)? {:?}", check(None).await.unwrap()); } ```