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
50
51
52
53
54
55
56
57
//! Declarative macros for pe-core.
//!
//! `core_state_fields!()` — convenience macro that embeds the standard
//! `CoreState` fields into a user's state struct.
/// Embeds the standard CoreState fields into a state struct.
///
/// These fields are required for any state that implements `CoreState`.
/// The `#[core]` attribute signals to `#[derive(State)]` that it should
/// generate the `CoreState` trait impl.
///
/// # Usage
///
/// ```ignore
/// use pe_core::core_state_fields;
///
/// #[derive(State, Clone, Debug, Serialize, Deserialize)]
/// struct MyAgentState {
/// core_state_fields!(),
///
/// // Your custom fields here
/// topic: String,
/// }
/// ```
///
/// # Expands to
///
/// ```ignore
/// #[core]
/// messages: Vec<Message>,
/// #[core]
/// iterations: u32,
/// #[core]
/// thread_id: String,
/// #[core]
/// context: ExecutionContext,
/// ```