Macros#
This section documents the macros provided by hyperactor for actor and message integration.
These macros support a complete message-passing workflow: from defining message enums and generating client APIs, to routing messages and exporting actors for dynamic or remote use.
#[derive(Handler)]— generate message handling and client traits for actor enums#[derive(HandleClient)]— implement the generated client trait forActorHandle<T>#[derive(RefClient)]— implement the generated client trait forActorRef<T>#[derive(Named)]— give a type a globally unique name and port for routing and reflection#[export]— make an actor remotely spawnable and routable by registering its type, handlers, and and optionally spawnable from outside the current runtime#[forward]— route messages to a user-defined handler trait implementation#[alias]- define a façade actor type that exposes only a curated set of messages, allowing you to hand out stable or restricted APIs without tying clients to the concrete actor
Macro Summary#
#[derive(Handler)]Generates handler and client traits for a message enum.#[derive(HandleClient)]Implements the client trait forActorHandle<T>.#[derive(RefClient)]Implements the client trait forActorRef<T>.#[derive(Named)]Registers the type with a globally unique name and port.#[export]Makes an actor spawnable and routable via inventory.#[forward]Forwards messages to a user-defined handler trait implementation.#[alias]Defines a façade actor that exposes only a curated set of messages.