Skip to content

Commit 8a47884

Browse files
committed
Add few docs.rs features annotations
1 parent bcc336d commit 8a47884

File tree

4 files changed

+52
-4
lines changed

4 files changed

+52
-4
lines changed

src/conn/opts/mod.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ pub struct SslOpts {
4444
impl SslOpts {
4545
/// Sets the client identity.
4646
#[cfg(any(feature = "native-tls", feature = "rustls"))]
47+
#[cfg_attr(
48+
docsrs,
49+
doc(cfg(any(
50+
feature = "native-tls",
51+
feature = "rustls-tls",
52+
feature = "rustls-tls-ring"
53+
)))
54+
)]
4755
pub fn with_client_identity(mut self, identity: Option<ClientIdentity>) -> Self {
4856
self.client_identity = identity;
4957
self
@@ -76,6 +84,14 @@ impl SslOpts {
7684
}
7785

7886
#[cfg(any(feature = "native-tls", feature = "rustls"))]
87+
#[cfg_attr(
88+
docsrs,
89+
doc(cfg(any(
90+
feature = "native-tls",
91+
feature = "rustls-tls",
92+
feature = "rustls-tls-ring"
93+
)))
94+
)]
7995
pub fn client_identity(&self) -> Option<&ClientIdentity> {
8096
self.client_identity.as_ref()
8197
}
@@ -141,13 +157,13 @@ pub(crate) struct InnerOpts {
141157
/// TCP keep alive interval between subsequent probe for mysql connection.
142158
///
143159
/// Can be defined using `tcp_keepalive_probe_interval_secs` connection url parameter.
144-
#[cfg(any(target_os = "linux", target_os = "macos",))]
160+
#[cfg(any(target_os = "linux", target_os = "macos"))]
145161
tcp_keepalive_probe_interval_secs: Option<u32>,
146162

147163
/// TCP keep alive probe count for mysql connection.
148164
///
149165
/// Can be defined using `tcp_keepalive_probe_count` connection url parameter.
150-
#[cfg(any(target_os = "linux", target_os = "macos",))]
166+
#[cfg(any(target_os = "linux", target_os = "macos"))]
151167
tcp_keepalive_probe_count: Option<u32>,
152168

153169
/// TCP_USER_TIMEOUT time for mysql connection.

src/error/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ pub enum Error {
6464
DriverError(DriverError),
6565
UrlError(UrlError),
6666
#[cfg(any(feature = "native-tls", feature = "rustls"))]
67+
#[cfg_attr(
68+
docsrs,
69+
doc(cfg(any(
70+
feature = "native-tls",
71+
feature = "rustls-tls",
72+
feature = "rustls-tls-ring"
73+
)))
74+
)]
6775
TlsError(tls::TlsError),
6876
FromValueError(Value),
6977
FromRowError(Row),

src/error/tls/mod.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
#![cfg(any(feature = "native-tls", feature = "rustls"))]
22

3-
pub mod native_tls_error;
4-
pub mod rustls_error;
3+
mod native_tls_error;
4+
mod rustls_error;
55

66
#[cfg(feature = "native-tls")]
7+
#[cfg_attr(
8+
docsrs,
9+
doc(cfg(any(
10+
feature = "native-tls",
11+
feature = "rustls-tls",
12+
feature = "rustls-tls-ring"
13+
)))
14+
)]
715
pub use native_tls_error::TlsError;
816

917
#[cfg(feature = "rustls")]
18+
#[cfg_attr(
19+
docsrs,
20+
doc(cfg(any(
21+
feature = "native-tls",
22+
feature = "rustls-tls",
23+
feature = "rustls-tls-ring"
24+
)))
25+
)]
1026
pub use rustls_error::TlsError;

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,14 @@ pub mod binlog {
916916
}
917917

918918
#[cfg(any(feature = "native-tls", feature = "rustls"))]
919+
#[cfg_attr(
920+
docsrs,
921+
doc(cfg(any(
922+
feature = "native-tls",
923+
feature = "rustls-tls",
924+
feature = "rustls-tls-ring"
925+
)))
926+
)]
919927
#[doc(inline)]
920928
pub use crate::conn::opts::ClientIdentity;
921929

0 commit comments

Comments
 (0)