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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//! Wall-clock readings.
//!
//! Wall-clock time is calendar time, sourced from the operating system's
//! real-time clock. It is the right tool for timestamps in logs, audit
//! records, and anything that needs to line up with what a wristwatch
//! shows. It is the wrong tool for measuring elapsed time — wall-clock
//! readings can jump backwards or forwards at any moment (NTP corrections,
//! DST changes, manual adjustments).
//!
//! For elapsed-time measurement, use [`Monotonic`](crate::Monotonic).
use ;
/// A captured wall-clock instant.
///
/// `Wall` wraps a single sample of the operating system's real-time clock.
/// Convert it to Unix time with [`unix_seconds`](Wall::unix_seconds),
/// [`unix_millis`](Wall::unix_millis), or [`unix_nanos`](Wall::unix_nanos).
///
/// `Wall` and [`Monotonic`](crate::Monotonic) are deliberately distinct
/// types and cannot be mixed. If your system clock predates the Unix
/// epoch (1970-01-01 UTC), the `unix_*` accessors saturate at zero — they
/// never panic and never silently wrap.
///
/// Construct one with [`Wall::now`] or the crate-level
/// [`wall`](crate::wall) shortcut.
///
/// # Examples
///
/// ```
/// use clock_lib::Wall;
///
/// let stamp = Wall::now();
/// let seconds = stamp.unix_seconds();
/// assert!(seconds > 0);
/// ```
SystemTime);