winping-rs 0.11.0

An easy-to-use ICMP Echo API for Windows programs without requiring elevated rights.
Documentation
//! winping - Easy ICMP Echo for Windows, and no elevated rights required!
//!
//! Published on crates.io as `winping-rs`, a maintained fork of the `winping` crate and a drop-in
//! replacement for it. The library target keeps the name `winping`, so `use winping::...` works
//! unchanged.
//!
//! Super basic ping.exe example
//!
//! ```rust
//! use std::net::IpAddr;
//! use winping::{Buffer, Pinger};
//!
//! fn main() {
//!     let dst = std::env::args()
//!         .nth(1)
//!         .unwrap_or(String::from("127.0.0.1"))
//!         .parse::<IpAddr>()
//!         .expect("Could not parse IP Address");
//!
//!     let pinger = Pinger::new().unwrap();
//!     let mut buffer = Buffer::new();
//!
//!     for _ in 0..4 {
//!         match pinger.send(dst, &mut buffer) {
//!             Ok(rtt) => println!("Response time {} ms.", rtt),
//!             Err(err) => println!("{}.", err),
//!         }
//!     }
//! }
//! ```
//!
#![cfg(any(target_os = "windows", doc))]
#![forbid(unreachable_patterns)]
#![allow(clippy::needless_doctest_main)]

#[cfg(feature = "async")]
mod async_pinger;
mod buffer;
mod error;
mod pinger;
pub(crate) mod util;

#[cfg(feature = "async")]
pub use async_pinger::{AsyncPinger, AsyncResult, PingFuture, set_async_buffer_size};
pub use buffer::Buffer;
pub use error::Error;
// Only the integration tests use `futures`; acknowledge it for the lib's own
// test target, which still exists for doctests and util's unit test.
#[cfg(test)]
use futures as _;
pub use pinger::{CreateError, IpPair, Pinger};