pub struct Connector<D: TlsDriver = Ssl> { /* private fields */ }
Expand description
A connector can be used to connect multiple times to the same target.
Implementations§
Source§impl Connector<Ssl>
impl Connector<Ssl>
Sourcepub fn new(target: Target) -> Result<Self, Error>
pub fn new(target: Target) -> Result<Self, Error>
Create a new connector with the given target and default resolver.
Sourcepub fn new_resolved(target: ResolvedTarget) -> Self
pub fn new_resolved(target: ResolvedTarget) -> Self
Create a new connector with the given resolved target.
Sourcepub fn new_with_resolver(target: Target, resolver: Resolver) -> Self
pub fn new_with_resolver(target: Target, resolver: Resolver) -> Self
Create a new connector with the given target and resolver.
Source§impl<D: TlsDriver> Connector<D>
impl<D: TlsDriver> Connector<D>
Sourcepub fn new_explicit(target: Target) -> Result<Self, Error>
pub fn new_explicit(target: Target) -> Result<Self, Error>
Create a new connector with the given TLS driver and default resolver.
Sourcepub fn new_explicit_resolved(target: ResolvedTarget) -> Self
pub fn new_explicit_resolved(target: ResolvedTarget) -> Self
Create a new connector with the given TLS driver and resolved target.
Sourcepub fn new_explicit_with_resolver(target: Target, resolver: Resolver) -> Self
pub fn new_explicit_with_resolver(target: Target, resolver: Resolver) -> Self
Create a new connector with the given TLS driver and resolver.
Sourcepub fn set_keepalive(&mut self, keepalive: Option<Duration>)
pub fn set_keepalive(&mut self, keepalive: Option<Duration>)
Set a keepalive for the connection. This is only supported for TCP connections and will be ignored for unix sockets.
Sourcepub fn ignore_missing_tls_close_notify(&mut self)
pub fn ignore_missing_tls_close_notify(&mut self)
For TLS connections, ignore a hard close where the socket was closed before receiving CLOSE_NOTIFY.
This may result in vulnerability to truncation attacks for protocols that do not include an implicit length, but may also result in spurious failures on Windows where sockets may be closed before the CLOSE_NOTIFY is received.
Sourcepub async fn connect(
&self,
) -> Result<UpgradableStream<TokioStream, D>, ConnectionError>
pub async fn connect( &self, ) -> Result<UpgradableStream<TokioStream, D>, ConnectionError>
Connect to the target.