21 unstable releases (3 breaking)
| new 0.10.0-rc.22 | Dec 3, 2025 |
|---|---|
| 0.10.0-rc.21 | Dec 2, 2025 |
| 0.10.0-rc.20 | Nov 27, 2025 |
| 0.10.0-rc.12 | Oct 30, 2025 |
| 0.2.1 | Aug 31, 2025 |
#7 in #sdk-macro
66 downloads per month
Used in 4 crates
(via calimero-sdk)
89KB
2K
SLoC
Procedural macros for Calimero SDK applications.
This module provides the core procedural macros that enable Calimero applications to define their state, logic, events, and private data structures with minimal boilerplate.
Key Macros
#[app::state]- Defines the application's persistent state structure#[app::logic]- Defines the application's business logic implementation#[app::event]- Defines application events for external communication#[app::private]- Defines private data structures for internal useapp::emit!- Emits events with optional callback handlers
Basic Usage
The macros work together to define application state, logic, and events:
- Use
#[app::state]to define persistent application state - Use
#[app::logic]to implement business logic methods - Use
#[app::event]to define events for external communication
Event Emission with Handlers
Use app::emit! macro to emit events:
- Simple emission:
app::emit!(MyEvent::DataChanged { data: "hello" }) - With callback handler:
app::emit!((MyEvent::CounterUpdated { value: 42 }, "counter_handler"))
Dependencies
~1–1.7MB
~39K SLoC