#meta #no-alloc #framework #odem-rs-meta

macro no-std odem-rs-meta

Language extensions for the ODEM-rs simulation framework

2 releases

Uses new Rust 2024

0.1.1 Feb 21, 2025
0.1.0 Feb 21, 2025

#660 in Science

27 downloads per month
Used in 4 crates (3 directly)

MIT license

48KB
423 lines

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.


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.

Dependencies

~3MB
~64K SLoC