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
//! Internal wall-clock formatting and monotonic-duration helpers.
//!
//! Scientific coordinates live in [`crate::system_state::SimulationTime`].
//! This module exists only for operational workflow timing: it obtains a UTC
//! timestamp for durable metadata and converts a process-local monotonic
//! [`std::time::Duration`] into an exact integer nanosecond count.
//!
//! Keeping these operations behind one private boundary prevents storage and
//! execution-scope code from choosing subtly different timestamp formats.
use Duration;
use OffsetDateTime;
use Rfc3339;
/// Returns the current UTC wall-clock time in canonical RFC 3339 form.
///
/// Nanosecond precision is requested by the `time` crate's well-known format;
/// insignificant trailing fractional digits may be omitted. The `Z` suffix is
/// guaranteed because the source value is explicitly UTC.
pub
/// Reports whether `value` is a syntactically valid UTC RFC 3339 timestamp.
pub
/// Converts a monotonic duration into an exact `u64` nanosecond count.
///
/// `None` is possible only for a duration longer than approximately 584 years;
/// callers turn that impossible-to-represent condition into their contextual
/// public error rather than truncating or saturating timing metadata.
pub