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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # Procedural Macro Utilities
//!
//! Provides custom derive macros for metrics collection and plugin systems.
//! Features must be explicitly enabled through crate features.
//!
//! ## Available Features
//! - `metrics`: Enables metrics collection derive macro
//! - `plugin`: Enables plugin system derive macro
//!
//! ## Example Usage
//! ```rust,ignore
//! #[cfg(feature = "metrics")]
//! #[derive(Metrics)]
//! struct NetworkMetrics {
//! bytes_sent: Counter,
//! bytes_received: Counter,
//! }
//!
//! #[cfg(feature = "plugin")]
//! #[derive(Plugin)]
//! struct MyPlugin {
//! config: PluginConfig,
//! }
//! ```
extern crate proc_macro;
extern crate proc_macro2;
/// Derive macro for implementing metrics collection
///
/// # Examples
/// ```rust,ignore
/// #[cfg(feature = "metrics")]
/// #[derive(Metrics)]
/// struct ServiceMetrics {
/// requests: Counter,
/// latency: Histogram,
/// errors: Gauge,
/// }
/// ```
/// Derive macro for creating plugin system interfaces
///
/// # Examples
/// ```rust,ignore
/// #[cfg(feature = "plugin")]
/// #[derive(Plugin)]
/// struct AuthPlugin {
/// priority: i32,
/// enabled: bool,
/// }
/// ```