Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caspervonb/serde_nanos
https://github.com/caspervonb/serde_nanos
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/caspervonb/serde_nanos
- Owner: caspervonb
- License: apache-2.0
- Created: 2021-12-01T12:23:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-04T13:31:18.000Z (9 months ago)
- Last Synced: 2024-10-31T11:27:24.770Z (2 months ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
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
```rust
use std::time::Duration;pub struct Message {
#[serde(with = "serde_nanos")]
expires_in: Duration,
}
```