Skip to main content

Reachability

Trait Reachability 

Source
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§

Source

fn ping(&self, ip: IpAddr, opts: PingOpts) -> Result<PingResult>

Send ICMP echo requests to ip according to opts.

Source

fn tcp_connect( &self, sa: SocketAddr, timeout: Duration, ) -> Result<TcpProbeResult>

Attempt a TCP three-way handshake to sa within timeout.

Source

fn tls_handshake( &self, sa: SocketAddr, sni: &str, timeout: Duration, ) -> Result<TlsProbeResult>

Perform a TLS handshake to sa with the given SNI within timeout.

Source

fn http_head(&self, url: &Url, timeout: Duration) -> Result<HttpProbeResult>

Issue an HTTP HEAD request to url within timeout.

Source

fn trace(&self, ip: IpAddr, opts: TraceOpts) -> Result<Vec<Hop>>

Run a traceroute to ip using opts.

Source

fn capabilities(&self) -> ProbeCapabilities

What this backend can actually do on this system.

Implementors§