aboutsummaryrefslogtreecommitdiff
path: root/net/async_rustls/src
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-22 05:21:42 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-22 05:21:42 +0200
commit741a83e1a59a9ed822ce6d1ab1a82d31a1cc854a (patch)
tree4fd02b04967aceed1a59b573f8e0b4677e7a9063 /net/async_rustls/src
parent9aa972dd83a85cec5da71e8e893eb6e07d5db8ca (diff)
net: compile rustls only if tls feature is enabled
Diffstat (limited to 'net/async_rustls/src')
-rw-r--r--net/async_rustls/src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/async_rustls/src/lib.rs b/net/async_rustls/src/lib.rs
new file mode 100644
index 0000000..4365552
--- /dev/null
+++ b/net/async_rustls/src/lib.rs
@@ -0,0 +1,12 @@
+#[cfg(all(feature = "smol", feature = "tokio"))]
+compile_error!("Only one async runtime feature should be enabled");
+
+#[cfg(not(any(feature = "smol", feature = "tokio")))]
+compile_error!("At least one async runtime feature must be enabled for this crate.");
+
+#[cfg(feature = "smol")]
+pub use futures_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream};
+
+#[cfg(feature = "tokio")]
+pub use tokio_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream};
+