Unverified Commit ad429c79 authored by James Wilson's avatar James Wilson Committed by GitHub
Browse files

hide internal macros from public interface (#755)

parent 7690a267
Pipeline #192415 passed with stages
in 5 minutes and 1 second
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#![warn(missing_docs, missing_debug_implementations, unreachable_pub)] #![warn(missing_docs, missing_debug_implementations, unreachable_pub)]
#[doc(hidden)] // Macros useful internally within this crate, but not to be exposed outside of it.
#[macro_use] #[macro_use]
pub mod macros; mod macros;
/// Error type. /// Error type.
pub mod error; pub mod error;
......
#[macro_export]
macro_rules! cfg_feature { macro_rules! cfg_feature {
($feature:literal, $($item:item)*) => { ($feature:literal, $($item:item)*) => {
$( $(
...@@ -11,19 +10,19 @@ macro_rules! cfg_feature { ...@@ -11,19 +10,19 @@ macro_rules! cfg_feature {
macro_rules! cfg_client { macro_rules! cfg_client {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("client", $($item)*); cfg_feature!("client", $($item)*);
}; };
} }
macro_rules! cfg_server { macro_rules! cfg_server {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("server", $($item)*); cfg_feature!("server", $($item)*);
}; };
} }
macro_rules! cfg_http_helpers { macro_rules! cfg_http_helpers {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("http-helpers", $($item)*); cfg_feature!("http-helpers", $($item)*);
}; };
} }
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
//! - **`client-ws-transport`** - Enables `ws` transport with TLS. //! - **`client-ws-transport`** - Enables `ws` transport with TLS.
//! - **`client-ws-transport-no-tls`** - Enables `ws` transport without TLS. //! - **`client-ws-transport-no-tls`** - Enables `ws` transport without TLS.
// Macros useful below, but not to be exposed outside of the crate.
#[macro_use] #[macro_use]
mod macros; mod macros;
......
#[macro_export]
macro_rules! cfg_feature { macro_rules! cfg_feature {
($feature:literal, $($item:item)*) => { ($feature:literal, $($item:item)*) => {
$( $(
...@@ -20,31 +19,31 @@ macro_rules! cfg_client { ...@@ -20,31 +19,31 @@ macro_rules! cfg_client {
macro_rules! cfg_http_client { macro_rules! cfg_http_client {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-http-client", $($item)*); cfg_feature!("jsonrpsee-http-client", $($item)*);
}; };
} }
macro_rules! cfg_ws_client { macro_rules! cfg_ws_client {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-ws-client", $($item)*); cfg_feature!("jsonrpsee-ws-client", $($item)*);
}; };
} }
macro_rules! cfg_wasm_client { macro_rules! cfg_wasm_client {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-wasm-client", $($item)*); cfg_feature!("jsonrpsee-wasm-client", $($item)*);
}; };
} }
macro_rules! cfg_async_client { macro_rules! cfg_async_client {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("async-client", $($item)*); cfg_feature!("async-client", $($item)*);
}; };
} }
macro_rules! cfg_client_transport { macro_rules! cfg_client_transport {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-client-transport", $($item)*); cfg_feature!("jsonrpsee-client-transport", $($item)*);
}; };
} }
...@@ -69,19 +68,19 @@ macro_rules! cfg_http_server { ...@@ -69,19 +68,19 @@ macro_rules! cfg_http_server {
macro_rules! cfg_ws_server { macro_rules! cfg_ws_server {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-ws-server", $($item)*); cfg_feature!("jsonrpsee-ws-server", $($item)*);
}; };
} }
macro_rules! cfg_proc_macros { macro_rules! cfg_proc_macros {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-proc-macros", $($item)*); cfg_feature!("jsonrpsee-proc-macros", $($item)*);
}; };
} }
macro_rules! cfg_types { macro_rules! cfg_types {
($($item:item)*) => { ($($item:item)*) => {
$crate::cfg_feature!("jsonrpsee-types", $($item)*); cfg_feature!("jsonrpsee-types", $($item)*);
}; };
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment