guinea_core/actor/
traits.rs1use crate::actor::Cx;
2use crate::actor::event_bus::builder::EventSubscription;
3
4pub trait Handler<M: 'static>: 'static {
5 const DECLARED: Option<crate::actor::shape::Declared> = None;
7
8 fn handle(&mut self, msg: M, cx: Cx<Self, M>)
9 where
10 Self: Sized;
11}
12
13pub trait ManagedActor: Sized + 'static {
14 type Bus: EventSubscription<Self>;
15 type Signals;
16 type Flow;
18 const SHAPE: crate::actor::shape::Shape = crate::actor::shape::Shape::UNKNOWN;
20}
21
22pub trait AllowedSignal<M: 'static> {}
23impl<M: 'static> AllowedSignal<M> for M {}