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
//! A set of macros to automatically deserialize standard attributes
//! 
//! # Getting Started
//! 
//! Make sure a Syn version is selected in features: `features = ["syn_2"]`
//! 
//!
//! Our attribute type is declared in a procedural macro crate:
//! ```rust
//! #[derive(Attribute)]
//! #[attr(name = "my_attr")] // We set the attribute name to 'my_attr'
//! struct MyAttribute {      // Note: The attribute name will be the struct name in snake_case by default
//!     name: String,
//!     // wrapping a type in an option will make it optional
//!     list: Option<NestedList>, // deserializes a meta list named list i.e. list(num = 1)
//!
//!     // booleans are always optional
//!     is_selected: bool,
//! }
//!     #[derive(List)]
//!     pub struct NestedList {
//!         num: Option<u8>
//!     }
//! ```
//! It can then be used to parse the following attribute using the from_attrs method:
//!
//! ```rust
//! #[my_attr(name = "some_name", is_selected)]
//! ```
//! 
//! For a more extensive guide check out the [github](https://github.com/RaccoonSupremacy/derive-attribute).

pub use derive_attribute_utils::*;
pub use derive_attribute_macros::*;

mod prelude {
    pub use derive_attribute_utils::{GetSpan, Attribute, TryFromMeta};
}