From b1dd46ae6a9f873e809ddc5aea8ea01ab7c39349 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 28 Jun 2015 10:15:33 -0700 Subject: [PATCH] Docs --- openssl/src/ssl/mod.rs | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 500e9aa4..0bbba4c8 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1016,12 +1016,8 @@ impl fmt::Debug for SslStream where S: fmt::Debug { } #[cfg(unix)] -impl SslStream { +impl SslStream { /// Creates an SSL/TLS client operating over the provided stream. - /// - /// `connect_direct` creates a more efficient `SslStream` than `connect` - /// does, but requires that the stream implement `AsRawFd` on Unix and - /// `AsRawSocket` on Windows. pub fn connect(ssl: T, stream: S) -> Result, SslError> { let ssl = try!(ssl.into_ssl()); let fd = stream.as_raw_fd() as c_int; @@ -1032,10 +1028,6 @@ impl SslStream { } /// Creates an SSL/TLS server operating over the provided stream. - /// - /// `accept_direct` creates a more efficient `SslStream` than `accept` - /// does, but requires that the stream implement `AsRawFd` on Unix and - /// `AsRawSocket` on Windows. pub fn accept(ssl: T, stream: S) -> Result, SslError> { let ssl = try!(ssl.into_ssl()); let fd = stream.as_raw_fd() as c_int; @@ -1047,12 +1039,8 @@ impl SslStream { } #[cfg(windows)] -impl SslStream { +impl SslStream { /// Creates an SSL/TLS client operating over the provided stream. - /// - /// `connect_direct` creates a more efficient `SslStream` than `connect` - /// does, but requires that the stream implement `AsRawFd` on Unix and - /// `AsRawSocket` on Windows. pub fn connect(ssl: T, stream: S) -> Result, SslError> { let fd = stream.as_raw_socket() as c_int; let stream = try!(DirectStream::connect(ssl, stream, fd)); @@ -1062,10 +1050,6 @@ impl SslStream { } /// Creates an SSL/TLS server operating over the provided stream. - /// - /// `accept_direct` creates a more efficient `SslStream` than `accept` - /// does, but requires that the stream implement `AsRawFd` on Unix and - /// `AsRawSocket` on Windows. pub fn accept(ssl: T, stream: S) -> Result, SslError> { let fd = stream.as_raw_socket() as c_int; let stream = try!(DirectStream::accept(ssl, stream, fd)); @@ -1077,6 +1061,10 @@ impl SslStream { impl SslStream { /// Creates an SSL/TLS client operating over the provided stream. + /// + /// `SslStream`s returned by this method will be less efficient than ones + /// returned by `connect`, so this method should only be used for streams + /// that do not implement `AsRawFd` and `AsRawSocket`. pub fn connect_generic(ssl: T, stream: S) -> Result, SslError> { let stream = try!(IndirectStream::connect(ssl, stream)); Ok(SslStream { @@ -1085,6 +1073,10 @@ impl SslStream { } /// Creates an SSL/TLS server operating over the provided stream. + /// + /// `SslStream`s returned by this method will be less efficient than ones + /// returned by `accept`, so this method should only be used for streams + /// that do not implement `AsRawFd` and `AsRawSocket`. pub fn accept_generic(ssl: T, stream: S) -> Result, SslError> { let stream = try!(IndirectStream::accept(ssl, stream)); Ok(SslStream {