-
Notifications
You must be signed in to change notification settings - Fork 172
/
macros.rs
88 lines (77 loc) · 1.78 KB
/
macros.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
macro_rules! cfg_feature {
($feature:literal, $($item:item)*) => {
$(
#[cfg(feature = $feature)]
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
$item
)*
}
}
macro_rules! cfg_client {
($($item:item)*) => {
$(
#[cfg(any(
feature = "jsonrpsee-http-client", feature = "jsonrpsee-wasm-client", feature = "jsonrpsee-ws-client",
feature = "client", feature = "async-client", feature = "client-core", feature = "async-wasm-client"
))]
$item
)*
}
}
macro_rules! cfg_http_client {
($($item:item)*) => {
cfg_feature!("jsonrpsee-http-client", $($item)*);
};
}
macro_rules! cfg_ws_client {
($($item:item)*) => {
cfg_feature!("jsonrpsee-ws-client", $($item)*);
};
}
macro_rules! cfg_wasm_client {
($($item:item)*) => {
cfg_feature!("jsonrpsee-wasm-client", $($item)*);
};
}
macro_rules! cfg_async_client {
($($item:item)*) => {
cfg_feature!("async-client", $($item)*);
};
}
macro_rules! cfg_client_transport {
($($item:item)*) => {
cfg_feature!("jsonrpsee-client-transport", $($item)*);
};
}
macro_rules! cfg_server {
($($item:item)*) => {
cfg_feature!("server", $($item)*);
}
}
macro_rules! cfg_server_core {
($($item:item)*) => {
cfg_feature!("server-core", $($item)*);
}
}
macro_rules! cfg_proc_macros {
($($item:item)*) => {
cfg_feature!("jsonrpsee-proc-macros", $($item)*);
};
}
macro_rules! cfg_types {
($($item:item)*) => {
cfg_feature!("jsonrpsee-types", $($item)*);
};
}
macro_rules! cfg_client_or_server {
($($item:item)*) => {
$(
#[cfg(any(
feature = "jsonrpsee-http-client", feature = "jsonrpsee-wasm-client", feature = "jsonrpsee-ws-client",
feature = "client", feature = "async-client", feature = "async-wasm-client",
feature = "client-core", feature = "server", feature = "server-core"
))]
$item
)*
}
}