syn_ext/
lib.rs

1//! Collections of syn shortcuts and editable interface.
2//!
3//! Start with `use syn_ext::ext::*;`
4//! Look around extension methods in [ext module](ext/index.html)
5
6#[cfg(any(feature = "derive", feature = "full"))]
7mod attribute;
8#[cfg(any(feature = "derive", feature = "full"))]
9mod generics;
10mod ident;
11#[cfg(feature = "full")]
12mod item;
13#[cfg(any(feature = "derive", feature = "full"))]
14mod meta;
15mod path;
16mod punctuated;
17#[cfg(test)]
18#[macro_use]
19mod test;
20
21/// `use syn_ext::ext::*`;  // Namespace module for extension traits.
22///
23/// Always try to use `*`.
24/// The public names here are intended to be used as `*` and will be changed any time.
25pub mod ext {
26    // only extension traits can be named here
27    mod basic {
28        pub use crate::ident::GetIdent;
29        pub use crate::punctuated::PunctuatedExt;
30    }
31    #[cfg(any(feature = "derive", feature = "full"))]
32    mod derive {
33        #[cfg(feature = "parsing")]
34        pub use crate::attribute::{AttributeExt, AttributeIteratorExt};
35        #[cfg(feature = "parsing")]
36        pub use crate::meta::MetaAttributeExt;
37        pub use crate::meta::{
38            MetaExt, MetaIteratorExt, NestedMetaIteratorExt, NestedMetaRefIteratorExt,
39        };
40        pub use crate::path::GetPath;
41    }
42    #[cfg(feature = "full")]
43    mod full {
44        pub use crate::item::{ItemAttrExt, ItemLike, ItemModExt};
45    }
46
47    pub use basic::*;
48    #[cfg(any(feature = "derive", feature = "full"))]
49    pub use derive::*;
50    #[cfg(feature = "full")]
51    pub use full::*;
52}
53
54pub mod types {
55    #[cfg(any(feature = "derive", feature = "full"))]
56    pub use crate::meta::{Meta1 as Meta, MetaList1 as MetaList, NestedMeta, PunctuatedNestedMeta};
57}