pub struct TlsConnector { /* private fields */ }Expand description
A wrapper around a rustls::ClientConfig.
Note: Clones are cheap.
Implementations§
Source§impl TlsConnector
impl TlsConnector
pub fn new(rustls_client_config: Arc<ClientConfig>) -> Self
pub async fn connect<S>(
&self,
domain: ServerName<'static>,
stream: S,
) -> Result<TlsStream<S, ClientConnection>>where
S: AsyncRead + AsyncWrite,
pub async fn connect_with<S, F>( &self, domain: ServerName<'static>, stream: S, f: F, ) -> Result<TlsStream<S, ClientConnection>>
pub fn with_alpn( &self, alpn_protocols: Vec<Vec<u8>>, ) -> TlsConnectorWithAlpn<'_>
Sourcepub fn config(&self) -> &Arc<ClientConfig>
pub fn config(&self) -> &Arc<ClientConfig>
Get a read-only reference to underlying config
Trait Implementations§
Source§impl Clone for TlsConnector
impl Clone for TlsConnector
Source§fn clone(&self) -> TlsConnector
fn clone(&self) -> TlsConnector
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for TlsConnector
impl !RefUnwindSafe for TlsConnector
impl Send for TlsConnector
impl Sync for TlsConnector
impl Unpin for TlsConnector
impl UnsafeUnpin for TlsConnector
impl !UnwindSafe for TlsConnector
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