Skip to main content

Crate rakka_macros

Crate rakka_macros 

Source
Expand description

Procedural macros for rakka. Ergonomics over rakka-core.

Exposes:

  • #[actor_msg] attribute — adds Debug derive and rakka-friendly conventions to a message enum.
  • #[derive(Actor)] with #[msg(MyMsgEnum)] — generates a thin impl Actor that delegates to the struct’s handle_msg method, removing the async_trait boilerplate users would otherwise repeat.
  • #[derive(Receive)] with #[msg(MyMsgEnum)] — generates a handle method that dispatches enum variants to on_<variant> methods on the actor (Phase 1.E of docs/full-port-plan.md).
  • props! macro — terse Props::create(|| ExprThatBuildsAnActor).

Macros§

props
props!(EXPR) — terse Props::create(|| EXPR).

Attribute Macros§

actor_msg
#[actor_msg] — sugar to declare a message enum.

Derive Macros§

Actor
#[derive(Actor)] with a #[msg(MyMsg)] attribute.
Receive
#[derive(Receive)] with a #[msg(MyMsg)] attribute on the actor struct, plus a separate enum MyMsg { Inc, Get(...), … } whose variants must be visible at the macro expansion site.