Skip to main content

HostPorts

Trait HostPorts 

Source
pub trait HostPorts: Send + Sync {
    // Required methods
    fn in_use(&self, port: u16, protocol: Protocol) -> bool;
    fn pick_free(&self, protocol: Protocol) -> Option<HeldPort>;
    fn reachable<'a>(
        &'a self,
        host: &'a str,
        port: u16,
        within: Duration,
    ) -> BoxFuture<'a, bool>;
}
Expand description

The host’s ports.

Required Methods§

Source

fn in_use(&self, port: u16, protocol: Protocol) -> bool

Whether port is taken over protocol on the loopback.

Source

fn pick_free(&self, protocol: Protocol) -> Option<HeldPort>

A free loopback port over protocol, held.

Source

fn reachable<'a>( &'a self, host: &'a str, port: u16, within: Duration, ) -> BoxFuture<'a, bool>

Whether host:port accepts a TCP connection within within.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§