From 78012267960737944747e87e995d1eaa22c5b4fc Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 12 Feb 2020 16:14:28 -0800 Subject: [PATCH] Tweak interface a bit --- openssl/src/ssl/connector.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs index a0ce87b5b..67ddb2a93 100644 --- a/openssl/src/ssl/connector.rs +++ b/openssl/src/ssl/connector.rs @@ -4,8 +4,8 @@ use std::ops::{Deref, DerefMut}; use dh::Dh; use error::ErrorStack; use ssl::{ - HandshakeError, Ssl, SslContext, SslContextRef, SslContextBuilder, SslMethod, SslMode, SslOptions, SslRef, - SslStream, SslVerifyMode, + HandshakeError, Ssl, SslContext, SslContextBuilder, SslContextRef, SslMethod, SslMode, + SslOptions, SslRef, SslStream, SslVerifyMode, }; use version; @@ -92,11 +92,13 @@ impl SslConnector { }) } - pub fn into_ssl_context(self) -> SslContext { + /// Consumes the `SslConnector`, returning the inner raw `SslContext`. + pub fn into_context(self) -> SslContext { self.0 } - pub fn ssl_context_ref(&self) -> &SslContextRef { + /// Returns a shared reference to the inner raw `SslContext`. + pub fn context(&self) -> &SslContextRef { &*self.0 } } @@ -310,11 +312,13 @@ impl SslAcceptor { ssl.accept(stream) } - pub fn into_ssl_context(self) -> SslContext { + /// Consumes the `SslAcceptor`, returning the inner raw `SslContext`. + pub fn into_context(self) -> SslContext { self.0 } - pub fn ssl_context_ref(&self) -> &SslContextRef { + /// Returns a shared reference to the inner raw `SslContext`. + pub fn context(&self) -> &SslContextRef { &*self.0 } } -- GitLab