Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 285 Bytes

README.md

File metadata and controls

13 lines (10 loc) · 285 Bytes

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,
}