Crate odem_rs_meta

Crate odem_rs_meta 

Source
Expand description

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

It includes four main macros:

  • until: 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.
  • sim_main: Wraps a user-defined async fn with optional arguments and return values into a synchronous wrapper-function that initializes and runs a simulation, returning its results.

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

Macros§

until
Creates a ControlExpr from a boolean expression, allowing asynchronous code to efficiently await a specific condition.

Attribute Macros§

sim_main
Generates a synchronous main function that sets up a simulator, runs the provided asynchronous simulation logic, and handles the results.

Derive Macros§

Config
Derives the Config-trait for a structure.
Publisher
Derives the Publisher-trait for a structure.