Struct aggligator_util::transport::tcp::TcpConnector
source · pub struct TcpConnector { /* private fields */ }Available on crate feature
tcp only.Expand description
TCP transport for outgoing connections.
Implementations§
source§impl TcpConnector
impl TcpConnector
sourcepub async fn new(
hosts: impl IntoIterator<Item = String>,
default_port: u16
) -> Result<Self>
pub async fn new(
hosts: impl IntoIterator<Item = String>,
default_port: u16
) -> Result<Self>
Create a new TCP transport for outgoing connections.
hosts can contain IP addresses and hostnames, including port numbers.
If an entry does not specify a port number, the default_port is used.
It is checked at creation that hosts resolves to at least one IP address.
Host name resolution is retried periodically, thus DNS updates will be taken into account without the need to recreate this transport.
sourcepub fn set_ip_version(&mut self, ip_version: IpVersion)
pub fn set_ip_version(&mut self, ip_version: IpVersion)
Sets the IP version used for connecting.
sourcepub fn set_resolve_interval(&mut self, resolve_interval: Duration)
pub fn set_resolve_interval(&mut self, resolve_interval: Duration)
Sets the interval for re-resolving the hostname and checking for changed network interfaces.
Trait Implementations§
source§impl Clone for TcpConnector
impl Clone for TcpConnector
source§fn clone(&self) -> TcpConnector
fn clone(&self) -> TcpConnector
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl ConnectingTransport for TcpConnector
impl ConnectingTransport for TcpConnector
Discovers link tags for connecting. Read more
source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 dyn LinkTag
) -> Pin<Box<dyn Future<Output = Result<IoBox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 dyn LinkTag
) -> Pin<Box<dyn Future<Output = Result<IoBox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Connects a link tag.
source§fn link_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
new: &'life1 Link<LinkTagBox>,
existing: &'life2 [Link<LinkTagBox>]
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn link_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
new: &'life1 Link<LinkTagBox>,
existing: &'life2 [Link<LinkTagBox>]
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Checks whether a new link can be added given existing links.