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<D: TlsDriver> Connector<D>
impl<D: TlsDriver> Connector<D>
pub fn new_explicit(target: Target) -> Result<Self, Error>
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.
pub async fn connect( &self, ) -> Result<UpgradableStream<TokioStream, D>, ConnectionError>
Auto Trait Implementations§
impl<D> Freeze for Connector<D>
impl<D = RustlsDriver> !RefUnwindSafe for Connector<D>
impl<D> Send for Connector<D>
impl<D> Sync for Connector<D>
impl<D> Unpin for Connector<D>
impl<D = RustlsDriver> !UnwindSafe for Connector<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more