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
44
45
46
47
48
49
use fnv1a_hash_str_32;
use Serialize;
use DeserializeOwned;
use Uuid;
/// Trait for events that can be published and handled by the event bus.
///
/// Implement this trait on your event types to make them processable.
///
/// # Example
///
/// ```rust
/// use fx_event_bus::Event;
/// use serde::{Serialize, Deserialize};
///
/// #[derive(Serialize, Deserialize, Clone)]
/// struct OrderCreated {
/// order_id: u64,
/// customer_name: String,
/// }
///
/// impl Event for OrderCreated {
/// const NAME: &'static str = "OrderCreated";
/// }
/// ```
/// Raw event data as stored in the database.
///
/// Contains the event metadata and JSON payload. Used internally
/// by handlers - you typically don't create these directly.