| 20 | } |
| 21 | |
| 22 | pub trait Message: Sync + Send + Any + Downcast { |
| 23 | fn externally_notifiable(&self) -> bool { |
| 24 | false |
| 25 | } |
| 26 | fn internally_notifiable(&self) -> bool { |
| 27 | false |
| 28 | } |
| 29 | |
| 30 | fn metadata(&self) -> MessageMetadata; |
| 31 | fn outbox(&self) -> Outbox { |
| 32 | let metadata = self.metadata(); |
| 33 | Outbox::new(metadata.aggregate_id, metadata.topic, self.state()) |
| 34 | } |
| 35 | fn message_clone(&self) -> Box<dyn Message>; |
| 36 | |
| 37 | fn state(&self) -> String; |
| 38 | } |
| 39 | impl_downcast!(Message); |
| 40 | impl Debug for dyn Message { |
| 41 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
no outgoing calls
no test coverage detected