1
0
forked from ROMEO/nexosim

Add optional serde support and make MonotonicTime serializable

This commit is contained in:
2024-03-12 18:11:06 +01:00
parent b96ffe7770
commit dc576013e5
3 changed files with 10 additions and 1 deletions

View File

@ -52,6 +52,7 @@ const NANOS_PER_SEC: u32 = 1_000_000_000;
/// assert_eq!(timestamp.subsec_nanos(), 443_654_321);
/// ```
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct MonotonicTime {
/// The number of whole seconds in the future (if positive) or in the past
/// (if negative) of 1970-01-01 00:00:00 TAI.