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 |
#519 in Encoding
2,993,509 downloads per month
Used in 192 crates
(6 directly)
13KB
294 lines
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.
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,
}
Dependencies
~155–740KB
~14K SLoC