1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/// This trait is used internally by the `ActorSystem` and builds the base for all messaging
/// It's automatically implemented by the `ActorMessage` trait that should be used
///
/// It is used by Messages defined in the system
/// All messages that use this trait directly should also implement a dynamic `Handler<M>` that applies to any `Actor`
/// This trait is used by Messages defined by the system
/// All messages that use this trait should also implement a dynamic `Handler<M>` that applies to any `Actor`
/// Core trait to define Messages
///
/// # Examples
///
/// Basic usage:
///
/// ```rust
/// use tyra::prelude::ActorMessage;
///
/// #[derive(ActorMessage)]
/// struct FooBar {
/// pub a: String,
/// }
///
/// let foo = FooBar::new(String::from("test"));
/// ```
/// this should be `BaseActorMessage` but it's currently not possible because of https://github.com/rust-lang/rust/issues/20400