5 releases
0.1.4 | Apr 4, 2024 |
---|---|
0.1.3 | Feb 20, 2023 |
0.1.2 | Jan 28, 2022 |
0.1.1 | Dec 1, 2021 |
0.1.0 | Dec 1, 2021 |
#6 in #timestamp
136,861 downloads per month
Used in 96 crates
(5 directly)
13KB
294 lines
A serde wrapper that can be used to serialize durations as nanoseconds. It's often useful together with serde_json to communicate with JSON protocols.
Example
use std::time::Duration;
pub struct Message {
#[serde(with = "serde_nanos")]
expires_in: Duration,
}
lib.rs
:
Serde Nanos
Documentation | Github | Crate
A serde wrapper that can be used to serialize timestamps and durations as nanoseconds.
It's often useful together with serde_json
to communicate with JSON
protocols.
Dependencies
~110–630KB
~12K SLoC