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
58
59
60
61
62
//! Fault injection traits for CSP state-driven error injection
//!
//! These traits enable type-safe fault injection by allowing CSP states and
//! events to be used as keys for fault configuration. They work independently
//! of the FDR exploration layer.
use Cow;
/// Trait for type-safe process state identifiers
///
/// Auto-implemented by `tb_gen_process_types!` macro or can be manually
/// implemented for custom state tracking in fault injection scenarios.
///
/// # Example
///
/// ```ignore
/// use tightbeam::testing::ProcessState;
///
/// #[derive(Debug, Clone, Copy)]
/// struct MyState;
///
/// impl ProcessState for MyState {
/// fn process_name(&self) -> &'static str { "MyProcess" }
/// fn state_name(&self) -> &'static str { "Ready" }
/// }
/// ```
/// Trait for type-safe process event identifiers
///
/// Auto-implemented by `tb_gen_process_types!` macro or can be manually
/// implemented for custom event tracking in fault injection scenarios.
///
/// # Example
///
/// ```ignore
/// use tightbeam::testing::ProcessEvent;
///
/// #[derive(Debug, Clone, Copy)]
/// struct MyEvent(&'static str);
///
/// impl ProcessEvent for MyEvent {
/// fn event_label(&self) -> &'static str { self.0 }
/// }
/// ```