#framework #publisher #traits #no-alloc #meta #control-expr

macro no-std odem-rs-meta

Language extensions for the ODEM-rs simulation framework

2 releases

new 0.1.1 Feb 21, 2025
0.1.0 Feb 21, 2025

#131 in Simulation


Used in 4 crates (3 directly)

MIT license

48KB
423 lines

ODEM-rs Meta

odem-rs-meta provides procedural macros to enhance the ODEM-rs simulation framework. It improves ergonomics during model development by offering some compile-time code generation.

Macros

  • derive_config: Derives the Config trait with optional attribute customization.
  • control_expr: Parses a condition into an awaitable ControlExpr used to model state-events.
  • derive_publisher: Generates Publisher trait implementations for state-events.

License

Licensed under MIT. See LICENSE for details.


lib.rs:

This crate provides procedural macros for meta-programming purposes to be used in concert with the ODEM-rs library.

It includes three main macros:

  • control_expr: Parses a condition into a ControlExpr that can be awaited.
  • derive_config: Derives the Config trait for a structure, supporting customizations through attributes.
  • derive_publisher: Generates the Publisher trait by subscribing to marked attributes.

For more details, refer to the documentation of each macro.

Dependencies

~1.3–2MB
~39K SLoC