Skip to content

Commit

Permalink
Add optional serde support and make MonotonicTime serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Mar 12, 2024
1 parent b96ffe7 commit dc57601
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# unreleased

- Add `serde` feature and serialization support for `MonotonicTime`.

# 0.2.1 (2024-03-06)

### Added
Expand All @@ -12,7 +16,6 @@

- Update copyright in MIT license to include contributors.


# 0.2.0 (2023-08-15)

### Added (API-breaking changes)
Expand Down
5 changes: 5 additions & 0 deletions asynchronix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions asynchronix/src/time/monotonic_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit dc57601

Please sign in to comment.