File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
+ categories = [" rust-patterns" , " development-tools::procedural-macro-helpers" , " parsing" ]
3
+ description = " Deriving with custom trait bounds"
4
+ documentation = " https://docs.rs/attribute-derive"
5
+ include = [" src/**/*" , " Cargo.toml" , " LICENSE-*" , " README.md" ]
6
+ keywords = [" derive" , " macro" ]
7
+ license = " MIT"
8
+ readme = " README.md"
9
+ repository = " https://github.com/ModProg/attribute-derive"
2
10
name = " attribute-derive"
3
11
version = " 0.1.0"
4
12
edition = " 2021"
5
13
6
14
[lib ]
7
15
8
16
[dependencies ]
9
- syn = " 1"
10
17
proc-macro2 = " 1"
18
+ syn = " 1"
11
19
12
20
[dependencies .macro ]
13
21
path = " macro"
14
22
23
+ [workspace ]
24
+ members = [" macro" ]
25
+
15
26
[dev-dependencies .syn ]
16
27
version = " 1"
17
28
features = [" full" ]
18
-
19
- [workspace ]
20
- members = [" macro" ]
Original file line number Diff line number Diff line change 1
- //! Basic gist is a struct like this :
1
+ //! Basicly clap for attribute macros :
2
2
//! ```ignore
3
3
//! #[derive(Attribute)]
4
4
//! #[attribute(ident = "collection")]
13
13
//! #[attribute(default)]
14
14
//! #[attribute(expected = "Error when an error occured while parsing")]
15
15
//! views: Vec<Type>,
16
+ //! // Booleans can be used without assiging a value. as a flag.
17
+ //! // If omitted they are set to false
18
+ //! some_flag
16
19
//! }
17
20
//! ```
18
21
//!
You can’t perform that action at this time.
0 commit comments