pub trait Message: 'static + Send {
type Response: 'static + Send;
}Expand description
Anything that you want to send to an actor.
Messages can have a response type like Ping and Pong in the following example.
#[message(response = Pong)]
struct Ping;
struct Pong; // does not need to implement `Message`Or they can be fire-and-forget messages like Stop in the following example.
#[message]
struct Store(&'static str);You can also derive the Message trait for simple messages without a response.
#[derive(Debug, Message)]
struct Store(&'static str);