Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
jsonrpsee
Commits
ad429c79
Unverified
Commit
ad429c79
authored
May 06, 2022
by
James Wilson
Committed by
GitHub
May 06, 2022
Browse files
hide internal macros from public interface (#755)
parent
7690a267
Pipeline
#192415
passed with stages
in 5 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/src/lib.rs
View file @
ad429c79
...
...
@@ -28,9 +28,9 @@
#![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]
pub
mod
macros
;
mod
macros
;
/// Error type.
pub
mod
error
;
...
...
core/src/macros.rs
View file @
ad429c79
#[macro_export]
macro_rules!
cfg_feature
{
(
$feature:literal
,
$
(
$item:item
)
*
)
=>
{
$
(
...
...
@@ -11,19 +10,19 @@ macro_rules! cfg_feature {
macro_rules!
cfg_client
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"client"
,
$
(
$item
)
*
);
cfg_feature!
(
"client"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_server
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"server"
,
$
(
$item
)
*
);
cfg_feature!
(
"server"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_http_helpers
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"http-helpers"
,
$
(
$item
)
*
);
cfg_feature!
(
"http-helpers"
,
$
(
$item
)
*
);
};
}
...
...
jsonrpsee/src/lib.rs
View file @
ad429c79
...
...
@@ -48,6 +48,7 @@
//! - **`client-ws-transport`** - Enables `ws` transport with 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]
mod
macros
;
...
...
jsonrpsee/src/macros.rs
View file @
ad429c79
#[macro_export]
macro_rules!
cfg_feature
{
(
$feature:literal
,
$
(
$item:item
)
*
)
=>
{
$
(
...
...
@@ -20,31 +19,31 @@ macro_rules! cfg_client {
macro_rules!
cfg_http_client
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-http-client"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-http-client"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_ws_client
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-ws-client"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-ws-client"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_wasm_client
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-wasm-client"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-wasm-client"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_async_client
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"async-client"
,
$
(
$item
)
*
);
cfg_feature!
(
"async-client"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_client_transport
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-client-transport"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-client-transport"
,
$
(
$item
)
*
);
};
}
...
...
@@ -69,19 +68,19 @@ macro_rules! cfg_http_server {
macro_rules!
cfg_ws_server
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-ws-server"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-ws-server"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_proc_macros
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-proc-macros"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-proc-macros"
,
$
(
$item
)
*
);
};
}
macro_rules!
cfg_types
{
(
$
(
$item:item
)
*
)
=>
{
$crate
::
cfg_feature!
(
"jsonrpsee-types"
,
$
(
$item
)
*
);
cfg_feature!
(
"jsonrpsee-types"
,
$
(
$item
)
*
);
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment