pub trait Reachability: Send + Sync {
// Required methods
fn ping(&self, ip: IpAddr, opts: PingOpts) -> Result<PingResult>;
fn tcp_connect(
&self,
sa: SocketAddr,
timeout: Duration,
) -> Result<TcpProbeResult>;
fn tls_handshake(
&self,
sa: SocketAddr,
sni: &str,
timeout: Duration,
) -> Result<TlsProbeResult>;
fn http_head(&self, url: &Url, timeout: Duration) -> Result<HttpProbeResult>;
fn trace(&self, ip: IpAddr, opts: TraceOpts) -> Result<Vec<Hop>>;
fn capabilities(&self) -> ProbeCapabilities;
}Expand description
Active probes: ICMP, TCP connect, TLS handshake, HTTP HEAD, traceroute.
Required Methods§
Sourcefn ping(&self, ip: IpAddr, opts: PingOpts) -> Result<PingResult>
fn ping(&self, ip: IpAddr, opts: PingOpts) -> Result<PingResult>
Send ICMP echo requests to ip according to opts.
Sourcefn tcp_connect(
&self,
sa: SocketAddr,
timeout: Duration,
) -> Result<TcpProbeResult>
fn tcp_connect( &self, sa: SocketAddr, timeout: Duration, ) -> Result<TcpProbeResult>
Attempt a TCP three-way handshake to sa within timeout.
Sourcefn tls_handshake(
&self,
sa: SocketAddr,
sni: &str,
timeout: Duration,
) -> Result<TlsProbeResult>
fn tls_handshake( &self, sa: SocketAddr, sni: &str, timeout: Duration, ) -> Result<TlsProbeResult>
Perform a TLS handshake to sa with the given SNI within timeout.
Sourcefn http_head(&self, url: &Url, timeout: Duration) -> Result<HttpProbeResult>
fn http_head(&self, url: &Url, timeout: Duration) -> Result<HttpProbeResult>
Issue an HTTP HEAD request to url within timeout.
Sourcefn trace(&self, ip: IpAddr, opts: TraceOpts) -> Result<Vec<Hop>>
fn trace(&self, ip: IpAddr, opts: TraceOpts) -> Result<Vec<Hop>>
Run a traceroute to ip using opts.
Sourcefn capabilities(&self) -> ProbeCapabilities
fn capabilities(&self) -> ProbeCapabilities
What this backend can actually do on this system.