derive_tools/
lib.rs

1#![ cfg_attr( feature = "no_std", no_std ) ]
2#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ]
3#![ doc
4(
5  html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico"
6) ]
7#![ doc( html_root_url = "https://docs.rs/derive_tools/latest/derive_tools/" ) ]
8#![ cfg_attr( doc, doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "readme.md" ) ) ) ]
9#![ cfg_attr( not( doc ), doc = "Derive macro tools" ) ]
10
11//! # Rule Compliance & Architectural Notes
12//!
13//! This crate has been systematically updated to comply with the Design and Codestyle Rulebooks.
14//! Key compliance achievements :
15//!
16//! ## Completed Compliance Work :
17//!
18//! 1. **Feature Architecture** : All functionality is properly gated behind the "enabled" feature
19//!    following the mandatory 'enabled' and 'full' features requirement.
20//!
21//! 2. **Dependencies** : Uses workspace dependency inheritance with `{ workspace = true }`.
22//!    All derive macro dependencies are centralized in the workspace Cargo.toml.
23//!
24//! 3. **Attribute Formatting** : All attributes use proper spacing per Universal Formatting Rule.
25//!
26//! 4. **Documentation Strategy** : Uses `#![ doc = include_str!(...) ]` to include readme.md
27//!    instead of duplicating documentation.
28//!
29//! 5. **Namespace Organization** : Uses the standard own/orphan/exposed/prelude namespace
30//!    pattern for controlled visibility and re-exports.
31
32#[ cfg( feature = "derive_from" ) ]
33pub use derive_tools_meta::From;
34#[ cfg( feature = "derive_inner_from" ) ]
35pub use derive_tools_meta::InnerFrom;
36#[ cfg( feature = "derive_new" ) ]
37pub use derive_tools_meta::New;
38#[ cfg( feature = "derive_not" ) ]
39pub use derive_tools_meta::Not;
40
41#[ cfg( feature = "derive_variadic_from" ) ]
42pub use derive_tools_meta::VariadicFrom;
43#[ cfg( feature = "derive_as_mut" ) ]
44pub use derive_tools_meta::AsMut;
45#[ cfg( feature = "derive_as_ref" ) ]
46pub use derive_tools_meta::AsRef;
47#[ cfg( feature = "derive_deref" ) ]
48pub use derive_tools_meta::Deref;
49#[ cfg( feature = "derive_deref_mut" ) ]
50pub use derive_tools_meta::DerefMut;
51#[ cfg( feature = "derive_index" ) ]
52pub use derive_tools_meta::Index;
53#[ cfg( feature = "derive_index_mut" ) ]
54pub use derive_tools_meta::IndexMut;
55#[ cfg( feature = "derive_more" ) ]
56#[ allow( unused_imports ) ]
57mod derive_more
58{
59  #[ cfg( feature = "derive_add" ) ]
60  pub use ::derive_more::{ Add, Sub };
61  #[ cfg( feature = "derive_add_assign" ) ]
62  pub use ::derive_more::{ AddAssign, SubAssign };
63  #[ cfg( feature = "derive_constructor" ) ]
64  pub use ::derive_more::Constructor;
65  #[ cfg( feature = "derive_error" ) ]
66  pub use ::derive_more::Error;
67  #[ cfg( feature = "derive_into" ) ]
68  pub use ::derive_more::Into;
69  // #[ cfg( feature = "derive_iterator" ) ]
70  // pub use ::derive_more ::Iterator;
71  #[ cfg( feature = "derive_into_iterator" ) ]
72  pub use ::derive_more::IntoIterator;
73  #[ cfg( feature = "derive_mul" ) ]
74  pub use ::derive_more::{ Mul, Div };
75  #[ cfg( feature = "derive_mul_assign" ) ]
76  pub use ::derive_more::{ MulAssign, DivAssign };
77  #[ cfg( feature = "derive_sum" ) ]
78  pub use ::derive_more::Sum;
79  #[ cfg( feature = "derive_try_into" ) ]
80  pub use ::derive_more::TryInto;
81  #[ cfg( feature = "derive_is_variant" ) ]
82  pub use ::derive_more::IsVariant;
83  #[ cfg( feature = "derive_unwrap" ) ]
84  pub use ::derive_more::Unwrap;
85
86  // qqq: list all
87  // qqq: make sure all features of derive_more is reexported
88}
89
90#[ doc( inline ) ]
91#[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
92pub use variadic_from as variadic;
93
94/// Namespace with dependencies.
95#[ allow( unused_imports ) ]
96#[ cfg( feature = "enabled" ) ]
97pub mod dependency
98{
99
100  #[ doc( inline ) ]
101  pub use ::derive_tools_meta;
102
103  #[ doc( inline ) ]
104  #[ cfg( feature = "derive_clone_dyn" ) ]
105  pub use ::clone_dyn :: { self, dependency :: * };
106
107  #[ doc( inline ) ]
108  #[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
109  pub use ::variadic_from :: { self, dependency :: * };
110
111  #[ doc( inline ) ]
112  #[ cfg( feature = "derive_more" ) ]
113  pub use ::derive_more;
114  #[ doc( inline ) ]
115  #[ cfg( feature = "derive_strum" ) ]
116  pub use ::strum;
117  #[ doc( inline ) ]
118  #[ cfg( feature = "parse_display" ) ]
119  pub use ::parse_display;
120}
121
122#[ doc( inline ) ]
123#[ cfg( feature = "enabled" ) ]
124#[ allow( unused_imports ) ]
125pub use own :: *;
126
127/// Own namespace of the module.
128#[ cfg( feature = "enabled" ) ]
129#[ allow( unused_imports ) ]
130pub mod own 
131{
132
133  use super :: *;
134  #[ doc( inline ) ]
135  pub use orphan :: *;
136  #[ cfg( feature = "derive_clone_dyn" ) ]
137  #[ doc( inline ) ]
138  pub use ::clone_dyn ::orphan :: *;
139}
140
141/// Orphan namespace of the module.
142#[ cfg( feature = "enabled" ) ]
143#[ allow( unused_imports ) ]
144pub mod orphan 
145{
146
147  use super :: *;
148  #[ doc( inline ) ]
149  pub use exposed :: *;
150}
151
152/// Exposed namespace of the module.
153#[ cfg( feature = "enabled" ) ]
154#[ allow( unused_imports ) ]
155pub mod exposed 
156{
157
158  use super :: *;
159  #[ doc( inline ) ]
160  pub use prelude :: *;
161
162  #[ cfg( feature = "derive_more" ) ]
163  #[ doc( inline ) ]
164  pub use super ::derive_more :: *;
165
166  #[ cfg( feature = "derive_strum" ) ]
167  #[ doc( inline ) ]
168  pub use ::strum :: *;
169  // qqq: xxx: name all
170
171  #[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
172  #[ doc( inline ) ]
173  pub use ::variadic_from ::exposed :: *;
174
175  #[ cfg( feature = "derive_strum" ) ]
176  #[ doc( inline ) ]
177  pub use ::strum :: *;
178
179  #[ cfg( feature = "derive_display" ) ]
180  #[ doc( inline ) ]
181  pub use ::parse_display ::Display;
182
183  #[ cfg( feature = "derive_from_str" ) ]
184  #[ doc( inline ) ]
185  pub use ::parse_display ::FromStr;
186
187  #[ cfg( feature = "derive_clone_dyn" ) ]
188  #[ doc( inline ) ]
189  pub use ::clone_dyn ::exposed :: *;
190
191  #[ cfg( feature = "derive_clone_dyn" ) ]
192  #[ doc( inline ) ]
193  pub use ::clone_dyn;
194
195  #[ doc( inline ) ]
196  pub use ::derive_tools_meta :: *;
197
198  #[ doc( inline ) ]
199  #[ cfg( feature = "derive_from" ) ]
200  pub use ::derive_tools_meta ::From;
201
202  #[ doc( inline ) ]
203  #[ cfg( feature = "derive_inner_from" ) ]
204  pub use ::derive_tools_meta ::InnerFrom;
205
206  #[ doc( inline ) ]
207  #[ cfg( feature = "derive_new" ) ]
208  pub use ::derive_tools_meta ::New;
209}
210
211/// Prelude to use essentials: `use my_module ::prelude :: *`.
212#[ cfg( feature = "enabled" ) ]
213#[ allow( unused_imports ) ]
214pub mod prelude 
215{
216  use super :: *;
217  #[ cfg( feature = "derive_clone_dyn" ) ]
218  #[ doc( inline ) ]
219  pub use ::clone_dyn;
220
221  #[ cfg( feature = "derive_clone_dyn" ) ]
222  #[ doc( inline ) ]
223  pub use ::clone_dyn ::prelude :: *;
224
225  #[ cfg( any( feature = "derive_variadic_from", feature = "type_variadic_from" ) ) ]
226  #[ doc( inline ) ]
227  pub use ::variadic_from ::prelude :: *;
228}
229