Struct rustls_connector::RustlsConnector
source · pub struct RustlsConnector(_);Expand description
The connector
Implementations§
source§impl RustlsConnector
impl RustlsConnector
sourcepub fn new_with_webpki_roots_certs() -> Self
pub fn new_with_webpki_roots_certs() -> Self
Create a new RustlsConnector using the webpki-roots certs (requires webpki-roots-certs feature enabled)
sourcepub fn new_with_native_certs() -> Result<Self>
pub fn new_with_native_certs() -> Result<Self>
Create a new RustlsConnector using the system certs (requires native-certs feature enabled)
Errors
Returns an error if we fail to load the native certs.
sourcepub fn connect<S: Debug + Read + Send + Sync + Write + 'static>(
&self,
domain: &str,
stream: S
) -> Result<TlsStream<S>, HandshakeError<S>>
pub fn connect<S: Debug + Read + Send + Sync + Write + 'static>( &self, domain: &str, stream: S ) -> Result<TlsStream<S>, HandshakeError<S>>
Connect to the given host
Errors
Returns a HandshakeError containing either the current state of the handshake or the
failure when we couldn’t complete the hanshake
Trait Implementations§
source§impl Clone for RustlsConnector
impl Clone for RustlsConnector
source§fn clone(&self) -> RustlsConnector
fn clone(&self) -> RustlsConnector
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 Default for RustlsConnector
impl Default for RustlsConnector
source§impl From<Arc<ClientConfig>> for RustlsConnector
impl From<Arc<ClientConfig>> for RustlsConnector
source§fn from(config: Arc<ClientConfig>) -> Self
fn from(config: Arc<ClientConfig>) -> Self
Converts to this type from the input type.
source§impl From<ClientConfig> for RustlsConnector
impl From<ClientConfig> for RustlsConnector
source§fn from(config: ClientConfig) -> Self
fn from(config: ClientConfig) -> Self
Converts to this type from the input type.