Skip to main content

Crate mae_macros

Crate mae_macros 

Source
Expand description

Procedural macros for Mae-Technologies micro-services.

This crate provides attribute and derive macros used across the Mae service ecosystem to reduce boilerplate for Actix-Web app setup, Postgres repository binding, and async integration testing.

see the Mae library for more details.

§Macros

§Attribute macros

  • run_app — rewrites an async fn run(…) stub into a complete Actix-Web server setup (session middleware, tracing, data extractors, listener binding).
  • schema — binds a struct to a Postgres schema, injecting standard audit columns and deriving [MaeRepo] plus the required SQL helper types.
  • schema_root — like schema but omits the sys_client foreign-key column; used for the root sys_client table itself.
  • mae_test — wraps an async fn test in a multi-threaded Tokio runtime, enforces Mae hygiene rules (no raw .unwrap()/assert*!), and supports optional docker-gating and teardown.

§Derive macros

  • [MaeRepo] — generates InsertRow, UpdateRow, Field, and PatchField types for a repository struct, wiring them to the mae::repo SQL layer.

Attribute Macros§

mae_test
#[mae_test] — the standard macro for async journey tests in Mae services.
run_app
Rewrites a single-statement function body into a full Actix-Web server setup.
schema
Binds a struct to a Postgres schema and injects standard Mae repository columns.
schema_root
Like schema but omits the auto-injected sys_client field.