rosey_actors/
messages.rs

1use std::{any::Any, fmt::Debug};
2
3use super::{ActorError, actor::ActorItem};
4
5pub type BoxedMessage = Box<dyn Any + Send + Sync + 'static>;
6
7pub trait Message: Any + Send + Sync + Debug {}
8impl<T> Message for T where T: Any + Send + Sync + Debug {}
9
10pub enum SystemMessage {
11	RegisterActor(ActorItem),
12	StopActor(&'static str),
13	StartActor(&'static str),
14	SendMsg(&'static str, BoxedMessage),
15	RestartActor(&'static str),
16	ActorTaskFinished(&'static str, Option<Result<(), ActorError>>),
17	Shutdown,
18	// Broadcast(BoxedMessage),
19}
20
21pub struct Shutdown {}