wd_macro/
lib.rs

1use proc_macro::TokenStream;
2
3mod global;
4
5///```rust
6///[dependencies]
7/// wd_tools = {features = ["sync"]} # version >= 0.13.14
8/// wd_macro = "0.4" # version >= 0.4
9///```
10///
11/// ```rust
12/// mod static_mod {
13///    #[derive(Default,Debug)]
14///    #[wd_macro::global]
15///    pub struct Config{
16///        pub name:String,
17///    }
18///}
19///
20///
21///fn main() {
22///    use static_mod::Config;
23///    let _:() = Config::lock_ref_mut(|x|{
24///        x.name = "teshin".into();
25///    });
26///    let name:String = Config::unsafe_mut_ptr(|x|{
27///        x.name.clone()
28///    });
29///    println!("name = {name}");
30///}
31#[proc_macro_attribute]
32pub fn global(attr: TokenStream, item: TokenStream) -> TokenStream {
33    global::global(attr, item)
34}