1
0
forked from ROMEO/nexosim

Merge pull request #19 from us-irs/add-serde-feature

Add optional serde feature
This commit is contained in:
Serge Barral 2024-03-12 18:15:16 +01:00 committed by GitHub
commit f5f0721663
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,7 @@
# unreleased
- Add `serde` feature and serialization support for `MonotonicTime`.
# 0.2.1 (2024-03-06)
### Added
@ -12,7 +16,6 @@
- Update copyright in MIT license to include contributors.
# 0.2.0 (2023-08-15)
### Added (API-breaking changes)

View File

@ -25,6 +25,7 @@ autotests = false
dev-hooks = []
# Logging of performance-related statistics; development only.
dev-logs = []
serde = ["dep:serde"]
[dependencies]
async-event = "0.1"
@ -39,6 +40,10 @@ slab = "0.4"
spin_sleep = "1"
st3 = "0.4"
[dependencies.serde]
version = "1"
optional = true
[target.'cfg(asynchronix_loom)'.dependencies]
loom = "0.5"
waker-fn = "1.1"

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.