Expand description
Acton Macro Library
This library provides procedural macros for the Acton actor framework. It includes macros to derive common traits and boilerplate code for Acton messages and actors.
§Message Macro
The acton_message macro simplifies creating message types for actor communication:
ⓘ
// Basic message for internal actor communication
#[acton_message]
pub struct Ping;
// IPC-enabled message with serialization support
#[acton_message(ipc)]
pub struct Request {
pub query: String,
}§Actor Macro
The acton_actor macro simplifies creating actor state types:
ⓘ
#[acton_actor]
pub struct Counter {
count: i32,
}§Main Entry Point
The acton_main macro provides a convenient entry point for Acton applications:
ⓘ
use acton_reactive::prelude::*;
#[acton_main]
async fn main() {
let mut app = ActonApp::launch_async().await;
// ... your application logic
app.shutdown_all().await;
}Attribute Macros§
- acton_
actor - A procedural macro to derive boilerplate traits for Acton actors.
- acton_
main - Entry point macro for Acton applications.
- acton_
message - A procedural macro to derive the necessary traits for an Acton message.