pub struct TlsConnectorWithAlpn<'c> {
inner: &'c TlsConnector,
alpn_protocols: Vec<Vec<u8>>,
}Fields§
§inner: &'c TlsConnector§alpn_protocols: Vec<Vec<u8>>Implementations§
Source§impl TlsConnectorWithAlpn<'_>
impl TlsConnectorWithAlpn<'_>
Sourcepub fn connect<IO>(self, domain: ServerName<'static>, stream: IO) -> Connect<IO> ⓘ
pub fn connect<IO>(self, domain: ServerName<'static>, stream: IO) -> Connect<IO> ⓘ
Returns a future that performs a TLS handshake with domain using the stream.
You likely want to wrap this in a timeout (for example with tokio::time::timeout)
to bound the handshake time.
Sourcepub fn connect_with<IO, F>(
self,
domain: ServerName<'static>,
stream: IO,
f: F,
) -> Connect<IO> ⓘ
pub fn connect_with<IO, F>( self, domain: ServerName<'static>, stream: IO, f: F, ) -> Connect<IO> ⓘ
Similar to Self::connect(), but calls f before performing the handshake.
As with Self::connect() you likely want to wrap this in a timeout to
bound the handshake time.
The f handler is given a mutable reference to a ClientConnection that can
be used for tasks like writing early data.
Auto Trait Implementations§
impl<'c> Freeze for TlsConnectorWithAlpn<'c>
impl<'c> !RefUnwindSafe for TlsConnectorWithAlpn<'c>
impl<'c> Send for TlsConnectorWithAlpn<'c>
impl<'c> Sync for TlsConnectorWithAlpn<'c>
impl<'c> Unpin for TlsConnectorWithAlpn<'c>
impl<'c> UnsafeUnpin for TlsConnectorWithAlpn<'c>
impl<'c> !UnwindSafe for TlsConnectorWithAlpn<'c>
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