maiko-macros
Procedural macros for the Maiko actor runtime.
This crate is a companion to maiko and is re-exported from it — you typically don't need to depend on it directly.
Macros
#[derive(Event)]
Implements maiko::Event for your type. This is a marker trait that bundles Clone + Send + Sync + 'static.
use Event;
#[derive(Label)]
Implements maiko::Label for enums, returning variant names as strings. Useful for logging, monitoring, and diagram generation.
use Label;
// MyTopic::SensorData.label() returns "SensorData"
Only works on enums.
#[derive(SelfRouting)]
Implements maiko::Topic<Self> for Self, enabling the event-as-topic pattern where each enum variant acts as its own routing topic.
use ;
Requires Clone, Hash, PartialEq, and Eq.
Notes
- All derive macros preserve generics and
whereclauses. - The macros generate impls referencing
maiko::paths, so themaikocrate must be in your dependency tree.
Minimum Supported Rust Version
1.85 (edition 2024)
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.