2 releases

new 0.1.1 Apr 19, 2025
0.1.0 Apr 17, 2025

#2433 in Procedural macros

Download history 72/week @ 2025-04-12

72 downloads per month

MIT/Apache

11KB
222 lines

rmqtt-macros

crates.io page docs.rs page

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 collectors
  • plugin – 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