pub trait Actor: Sized {
type Message;
// Required method
async fn on_mount<M>(&mut self, _: DynamicAddress<Self::Message>, _: M) -> !
where M: Inbox<Self::Message>;
}Expand description
Trait that each actor must implement. An actor defines a message type
that it acts on, and an implementation of on_mount which is invoked
when the actor is started.
At run time, an Actor is held within an ActorContext, which contains the embassy task and the message queues. The size of the message queue is configured per ActorContext.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.