Skip to main content

Message

Derive Macro Message 

Source
#[derive(Message)]
{
    // Attributes available to this derive:
    #[result_type]
}
Expand description

Derive the Message trait for a struct or enum.

The result_type attribute is required and specifies the type returned when the message is handled by an actor.

§Examples

use acktor_derive::{Message, MessageResponse};

#[derive(MessageResponse)]
struct Sum(i64);

#[derive(Message)]
#[result_type(Sum)]
struct Add(i64, i64);