1macro_rules! cfg_feature {
2 ($feature:literal, $($item:item)*) => {
3 $(
4 #[cfg(feature = $feature)]
5 #[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
6 $item
7 )*
8}
9}
10
11macro_rules! cfg_client {
12 ($($item:item)*) => {
13 cfg_feature!("client", $($item)*);
14 };
15}
16
17macro_rules! cfg_server {
18 ($($item:item)*) => {
19 cfg_feature!("server", $($item)*);
20 };
21}
22
23macro_rules! cfg_client_or_server {
24 ($($item:item)*) => {
25 $(
26 #[cfg(any(feature = "client", feature = "server"))]
27 $item
28 )*
29 }
30}
31
32macro_rules! cfg_http_helpers {
33 ($($item:item)*) => {
34 cfg_feature!("http-helpers", $($item)*);
35 };
36}
37
38macro_rules! cfg_async_client {
39 ($($item:item)*) => {
40 $(
41 #[cfg(any(feature = "async-wasm-client", feature = "async-client"))]
42 #[cfg_attr(docsrs, doc(cfg(feature = "async-client")))]
43 #[cfg_attr(docsrs, doc(cfg(feature = "async-wasm-client")))]
44 $item
45 )*
46 }
47}