serde_nanos

Crates.ioserde_nanos
lib.rsserde_nanos
version0.1.4
sourcesrc
created_at2021-12-01 12:35:36.590905
updated_at2024-04-04 13:28:51.632423
descriptionWrapper to process duration and timestamps as nanoseconds
homepage
repositoryhttps://github.com/caspervonb/serde_nanos
max_upload_size
id490233
size29,194
Casper Beyer (caspervonb)

documentation

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

use std::time::Duration;

pub struct Message {
    #[serde(with = "serde_nanos")]
    expires_in: Duration,
}
Commit count: 11

cargo fmt