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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
use crate::;
use Serialize;
use ;
/// Indicates to Antithesis that setup has completed. Call this function when
/// your system and workload are fully initialized. After this function is
/// called, Antithesis will take a snapshot of your system and begin
/// [injecting faults]( https://antithesis.com/docs/environment/fault_injection/).
///
/// Calling this function multiple times or from multiple processes will have no
/// effect. Antithesis will treat the first time any process called this
/// function as the moment that the setup was completed.
///
/// Details may be any borrowed value implementing `Serialize`. Objects are
/// preserved; other non-null JSON values are wrapped under `"value"`, for
/// example `3` becomes `{"value": 3}`. Pass `&()` or `&Value::Null` for no
/// details; an explicit empty object is preserved. Serialization errors emit an
/// `antithesis_error` message and omit details; the setup event is still
/// emitted. With the `full` feature disabled, details are not serialized.
///
/// # Example
///
/// ```
/// use serde_json::{json, Value};
/// use antithesis_sdk::lifecycle;
///
/// let (num_nodes, main_id) = (10, "n-001");
///
/// let startup_data: Value = json!({
/// "num_nodes": num_nodes,
/// "main_node_id": main_id,
/// });
///
/// lifecycle::setup_complete(&startup_data);
/// ```
Sized>
/// Indicates to Antithesis that a certain event has been reached. It sends a
/// structured log message to Antithesis that you may later use to aid
/// debugging.
///
/// In addition to ``details``, you also provide ``name``, which is the name of
/// the event that you are logging.
///
/// Details may be any borrowed value implementing `Serialize`. Objects are
/// preserved; other non-null JSON values are wrapped under `"value"`, for
/// example `3` becomes `{"value": 3}`. Null and serialization errors produce an
/// empty event body `{}`. Serialization errors also emit an `antithesis_error`
/// message. With the `full` feature disabled, details are not serialized.
///
/// # Example
///
/// ```
/// use serde_json::{json, Value};
/// use antithesis_sdk::lifecycle;
///
/// let info_value: Value = json!({
/// "month": "July",
/// "day": 17
/// });
///
/// lifecycle::send_event("start_day", &info_value);
/// ```
Sized>