[](https://crates.io/crates/ekko) [](https://deps.rs/crate/ekko/0.2.0) [](https://docs.rs/ekko) [](https://choosealicense.com/licenses/mit/)
Ekko is a simple and light utility for sending echo requests, giving you (mostly) everything you need.
To use ekko
, add this to your Cargo.toml
:
toml
[dependencies]
ekko = "0.2.1"
The following example will trace the route to the specified destination. ```rust use ekko::{ error::{EkkoError}, EkkoResponse, Ekko, };
fn main() -> Result<(), EkkoError> { let mut ping = Ekko::with_target("rustup.rs")?;
for hops in 1..32 {
let response = ping.send(hops)?;
match response {
EkkoResponse::DestinationResponse(data) => {
println!("DestinationResponse: {:#?}", data);
break
}
EkkoResponse::UnreachableResponse((data, reason)) => {
println!("UnreachableResponse: {:#?} | {:#?}", data, reason);
continue
}
EkkoResponse::UnexpectedResponse((data, (t, c))) => {
println!("UnexpectedResponse: ({}, {}), {:#?}", t, c, data);
continue
}
EkkoResponse::ExceededResponse(data) => {
println!("ExceededResponse: {:#?}", data);
continue
}
EkkoResponse::LackingResponse(data) => {
println!("LackingResponse: {:#?}", data);
continue
}
}
}
Ok(())
} ```
All contributions are welcome, don't hesitate to open an issue if something is missing!