blob: d6a3c37edc246bf7ee104dbd40c007fce86f7eed (
plain) (
blame)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
#![doc = include_str!("../doc/lib.md")]
#![deny(missing_docs)]
use proc_macro::TokenStream;
pub(crate) mod config;
pub(crate) mod func;
pub(crate) mod invoke;
pub(crate) mod select;
pub(crate) use proc_macro2::TokenStream as TokenStream2;
pub(crate) use syn::Result as SynResult;
#[doc = include_str!("../doc/func.md")]
///
/// # How to use?
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/func.rs")]
/// ```
///
/// # Expanded
///
/// The above code will be expanded into the following:
///
/// Sync:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/func_expand.rs")]
/// ```
///
/// Async:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/func_async_expand.rs")]
/// ```
#[proc_macro_attribute]
pub fn func(attr: TokenStream, item: TokenStream) -> TokenStream {
func::func(attr, item)
}
#[doc = include_str!("../doc/invoke.md")]
///
/// # How to use?
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/invoke.rs")]
/// ```
///
/// # Expanded
///
/// The above code will be expanded into the following:
///
/// Sync:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/invoke_expand.rs")]
/// ```
///
/// Async:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/invoke_async_expand.rs")]
/// ```
#[proc_macro]
pub fn invoke(input: TokenStream) -> TokenStream {
invoke::invoke(input)
}
#[doc = include_str!("../doc/select.md")]
///
/// # How to use?
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/select.rs")]
/// ```
///
/// # Expanded
///
/// The above code will be expanded into the following:
///
/// Sync:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/select_expand.rs")]
/// ```
///
/// Async:
///
/// ```
/// # use might_be_async::*;
#[doc = include_str!("../doc/usage/select_async_expand.rs")]
/// ```
#[proc_macro]
pub fn select(input: TokenStream) -> TokenStream {
select::select(input)
}
|