Attribute Macro vin_macros::actor

source ·
#[actor]
Expand description

Generates the actor impls and forms necessary fields.

Additional arguments

Currently there is only one additional argument and it’s ‘bounded’.

bounded

The bounded argument allows you to set an upper limit to the amount of messages a mailbox can take in. It also allows you to set a strategy for handling a full mailbox. Current available strategies are: ‘wait’ (awaits until the mailbox is available), ‘report’ (reports a failure) and ‘silent’ (silently discards the message).

Example

#[vin::actor]
#[vin::handles(MyMsg, bounded(size = 1024, report))]
struct MyActor;