Skip to main content

syn_ext/
lib.rs

1//! Collections of syn shortcuts and editable interface.
2//!
3//! # Deprecated
4//!
5//! This crate is deprecated. Use [syn](https://docs.rs/syn/) directly instead.
6//!
7//! syn-ext is a shortcut utility over syn. With LLM assistance available for writing
8//! the equivalent code directly against syn, this shortcut abstraction is no longer
9//! worth maintaining as a separate crate. Prefer direct syn APIs and keep any small,
10//! project-specific helpers in your own code.
11//!
12//! Start with `use syn_ext::ext::*;`
13//! Look around extension methods in [ext module](ext/index.html)
14
15#[cfg(any(feature = "derive", feature = "full"))]
16mod attribute;
17#[cfg(any(feature = "derive", feature = "full"))]
18mod generics;
19mod ident;
20#[cfg(feature = "full")]
21mod item;
22#[cfg(any(feature = "derive", feature = "full"))]
23mod meta;
24mod path;
25mod punctuated;
26#[cfg(test)]
27#[macro_use]
28mod test;
29
30/// `use syn_ext::ext::*`;  // Namespace module for extension traits.
31///
32/// Always try to use `*`.
33/// The public names here are intended to be used as `*` and will be changed any time.
34pub mod ext {
35    // only extension traits can be named here
36    mod basic {
37        pub use crate::ident::GetIdent;
38        pub use crate::punctuated::PunctuatedExt;
39    }
40    #[cfg(any(feature = "derive", feature = "full"))]
41    mod derive {
42        #[cfg(feature = "parsing")]
43        pub use crate::attribute::{AttributeExt, AttributeIteratorExt};
44        #[cfg(feature = "parsing")]
45        pub use crate::meta::MetaAttributeExt;
46        pub use crate::meta::{
47            MetaExt, MetaIteratorExt, NestedMetaIteratorExt, NestedMetaRefIteratorExt,
48        };
49        pub use crate::path::GetPath;
50    }
51    #[cfg(feature = "full")]
52    mod full {
53        pub use crate::item::{ItemAttrExt, ItemLike, ItemModExt};
54    }
55
56    pub use basic::*;
57    #[cfg(any(feature = "derive", feature = "full"))]
58    pub use derive::*;
59    #[cfg(feature = "full")]
60    pub use full::*;
61}
62
63pub mod types {
64    #[cfg(any(feature = "derive", feature = "full"))]
65    pub use crate::meta::{Meta1 as Meta, MetaList1 as MetaList, NestedMeta, PunctuatedNestedMeta};
66}