Struct compio_tls::TlsConnector
source · pub struct TlsConnector(/* private fields */);
Expand description
A wrapper around a native_tls::TlsConnector
or rustls::ClientConfig
,
providing an async connect
method.
Implementations§
source§impl TlsConnector
impl TlsConnector
sourcepub async fn connect<S: AsyncRead + AsyncWrite>(
&self,
domain: &str,
stream: S,
) -> Result<TlsStream<S>>
pub async fn connect<S: AsyncRead + AsyncWrite>( &self, domain: &str, stream: S, ) -> Result<TlsStream<S>>
Connects the provided stream with this connector, assuming the provided domain.
This function will internally call TlsConnector::connect
to connect
the stream and returns a future representing the resolution of the
connection operation. The returned future will resolve to either
TlsStream<S>
or Error
depending if it’s successful or not.
This is typically used for clients who have already established, for example, a TCP connection to a remote server. That stream is then provided here to perform the client half of a connection to a TLS-powered server.
Trait Implementations§
source§impl Clone for TlsConnector
impl Clone for TlsConnector
source§fn clone(&self) -> TlsConnector
fn clone(&self) -> TlsConnector
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 Debug for TlsConnector
impl Debug for TlsConnector
source§impl From<Arc<ClientConfig>> for TlsConnector
Available on crate feature rustls
only.
impl From<Arc<ClientConfig>> for TlsConnector
Available on crate feature
rustls
only.source§fn from(value: Arc<ClientConfig>) -> Self
fn from(value: Arc<ClientConfig>) -> Self
Converts to this type from the input type.
source§impl From<TlsConnector> for TlsConnector
Available on crate feature native-tls
only.
impl From<TlsConnector> for TlsConnector
Available on crate feature
native-tls
only.source§fn from(value: TlsConnector) -> Self
fn from(value: TlsConnector) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TlsConnector
impl !RefUnwindSafe for TlsConnector
impl Send for TlsConnector
impl Sync for TlsConnector
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)