pub enum Connector {
Plain,
NativeTls(TlsConnector),
Rustls(TlsConnector),
}Expand description
A reusable TLS connector for wrapping streams.
Variants§
Plain
Plain (non-TLS) connector.
NativeTls(TlsConnector)
Available on crate feature
native-tls only.native-tls TLS connector.
Rustls(TlsConnector)
Available on crate features
rustls-native-roots or rustls-webpki-roots or rustls-platform-verifier or rustls-bring-your-own-connector only.rustls TLS connector.
Implementations§
Source§impl Connector
impl Connector
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Creates a new Connector with the underlying TLS library specified in
the feature flags.
§Errors
This method returns an Error when creating the underlying TLS
connector fails.
§Panics
Panics if no rustls crypto provider is installed and rustls is unable to determine a default crypto provider from its feature flags.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connector
impl !RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl !UnwindSafe for Connector
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