Expand description
The derive macros of zestors, re-exported in zestors::prelude:
Message: a message, fire-and-forget or with a reply.Interface: the set of messages an actor accepts.HandlerInterface: dispatch from an interface to aHandler’sHandle<M>implementations.StableId: a message’s id on the wire, for sending it to other nodes.
§Attributes
All derives read #[msg(...)] and #[zestors(...)]; the two are
interchangeable.
| Key | Used by | Meaning |
|---|---|---|
reply = T | Message | The message expects a reply of type T. Quote types with generics: reply = "Option<u32>". |
id = "<uuid>" | StableId | The message’s id. Required. |
no_auto_register | StableId | Leave the type out of ClusterConfig::auto_register. |
interface_path = "path" | Message, Interface | Where to find zestors-interface. Default ::zestors::interface. |
actor_path = "path" | HandlerInterface | Where to find zestors-actor. Default ::zestors::actor. |
distr_path = "path" | StableId | Where to find zestors-distr. Default ::zestors::distr. |
The path keys are only needed when depending on the zestors-* crates
directly instead of on zestors.
Derive Macros§
- Handler
Interface - Derives the
HandlerInterfacetrait for an enum, which dispatches each variant to theHandle<M>implementation of aHandler. Use it next to#[derive(Interface)]on the enum that is the handler’sInterface. - Interface
- Derives the
Interfacetrait for an enum: the set of messages an actor accepts. - Message
- Derives the
Messagetrait. - Stable
Id - Derives the
StableIdtrait, giving the message a stable, globally uniqueMessageIdthat identifies it across nodes.