2 releases
new 0.1.1 | Apr 19, 2025 |
---|---|
0.1.0 | Apr 17, 2025 |
#2433 in Procedural macros
72 downloads per month
11KB
222 lines
rmqtt-macros
✨ rmqtt-macros provides a collection of procedural macros to enhance the RMQTT ecosystem, including support for metrics collection and plugin systems. All macros are gated by feature flags for modular usage.
🔧 Features
metrics
– Enables the#[derive(Metrics)]
macro for auto-generating metric collectorsplugin
– Enables the#[derive(Plugin)]
macro for building dynamic plugin systems
📦 Example
#[cfg(feature = "metrics")]
#[derive(Metrics)]
struct NetworkMetrics {
bytes_sent: Counter,
bytes_received: Counter,
}
#[cfg(feature = "plugin")]
#[derive(Plugin)]
struct MyPlugin {
config: PluginConfig,
}
📚 Crate Usage
To use a specific macro, enable the corresponding feature in your Cargo.toml
:
[dependencies]
rmqtt-macros = { version = "0.1", features = ["metrics", "plugin"] }
🚀 Designed for RMQTT
This crate is intended for internal use within the RMQTT project but can be reused in other systems requiring similar functionality.
Dependencies
~200–630KB
~15K SLoC