rmqtt-macros

Crates.iormqtt-macros
lib.rsrmqtt-macros
version0.1.1
created_at2025-04-17 14:53:22.960726+00
updated_at2025-04-19 10:03:51.453288+00
descriptionProcedural Macro Utilities
homepage
repositoryhttps://github.com/rmqtt/rmqtt.git
max_upload_size
id1637942
size12,785
(bittcrafter)

documentation

README

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.

Commit count: 1739

cargo fmt