summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2021-05-12 12:47:19 +0100
committerEmīls <emils@mullvad.net>2021-05-12 13:57:35 +0100
commit535c2624fdf8c145aab24c20cd2ae02e921663c4 (patch)
tree703df78fc61e9df78135a9531a0d3107d8a1b38a
parentd53c2926fdab33637f8f290acb07983cfe71e87c (diff)
downloadmullvadvpn-535c2624fdf8c145aab24c20cd2ae02e921663c4.tar.xz
mullvadvpn-535c2624fdf8c145aab24c20cd2ae02e921663c4.zip
Add docs for unix pinger
-rw-r--r--talpid-core/src/ping_monitor/unix.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/talpid-core/src/ping_monitor/unix.rs b/talpid-core/src/ping_monitor/unix.rs
index 4207f0db04..e7e7927349 100644
--- a/talpid-core/src/ping_monitor/unix.rs
+++ b/talpid-core/src/ping_monitor/unix.rs
@@ -1,10 +1,13 @@
use std::{io, net::Ipv4Addr};
+/// Pinger errors
#[derive(err_derive::Error, Debug)]
pub enum Error {
+ /// Failed to run `ping` process
#[error(display = "Failed to run ping command")]
PingError(#[error(source)] io::Error),
+ /// ICMP timed out
#[error(display = "Ping timed out")]
TimeoutError,
}
@@ -17,6 +20,7 @@ pub struct Pinger {
}
impl Pinger {
+ /// Creates a new pinger that will send ICMP requests only through the specified interface
pub fn new(addr: Ipv4Addr, interface_name: String) -> Result<Self, Error> {
Ok(Self {
processes: vec![],