Struct tokio_tls::TlsConnector
source · [−]pub struct TlsConnector(_);
Expand description
A wrapper around a native_tls::TlsConnector
, providing an async connect
method.
Implementations
sourceimpl TlsConnector
impl TlsConnector
sourcepub async fn connect<S>(
&self,
domain: &str,
stream: S
) -> Result<TlsStream<S>, Error> where
S: AsyncRead + AsyncWrite + Unpin,
pub async fn connect<S>(
&self,
domain: &str,
stream: S
) -> Result<TlsStream<S>, Error> where
S: AsyncRead + AsyncWrite + Unpin,
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
sourceimpl Clone for TlsConnector
impl Clone for TlsConnector
sourcefn clone(&self) -> TlsConnector
fn clone(&self) -> TlsConnector
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TlsConnector
impl Debug for TlsConnector
sourceimpl From<TlsConnector> for TlsConnector
impl From<TlsConnector> for TlsConnector
sourcefn from(inner: TlsConnector) -> TlsConnector
fn from(inner: TlsConnector) -> TlsConnector
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for TlsConnector
impl Send for TlsConnector
impl Sync for TlsConnector
impl Unpin for TlsConnector
impl UnwindSafe for TlsConnector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more