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 const ANSWERS: bool = false;
12
13 fn handle(&mut self, msg: M, cx: Cx<Self, M>)
14 where
15 Self: Sized;
16}
17
18pub trait ManagedActor: Sized + 'static {
19 type Bus: EventSubscription<Self>;
20 type Signals;
21 type Flow;
23 const SHAPE: crate::actor::shape::Shape = crate::actor::shape::Shape::UNKNOWN;
25}
26
27pub trait AllowedSignal<M: 'static> {}
28impl<M: 'static> AllowedSignal<M> for M {}