6 releases (stable)

1.1.1 Mar 11, 2022
1.0.1 Sep 14, 2020
1.0.0 Jan 29, 2020
0.1.1 May 24, 2019
0.1.0 May 24, 2019

#40 in Encoding

Download history 196468/week @ 2024-07-23 190275/week @ 2024-07-30 189137/week @ 2024-08-06 214923/week @ 2024-08-13 226062/week @ 2024-08-20 214502/week @ 2024-08-27 249775/week @ 2024-09-03 239729/week @ 2024-09-10 223723/week @ 2024-09-17 262180/week @ 2024-09-24 256070/week @ 2024-10-01 279294/week @ 2024-10-08 286041/week @ 2024-10-15 307339/week @ 2024-10-22 292279/week @ 2024-10-29 307599/week @ 2024-11-05

1,237,369 downloads per month
Used in 375 crates (129 directly)

MIT/Apache

15KB
301 lines

Apache 2.0 licensed MIT licensed

humantime-serde

Serde support for the humantime crate.

Heavily based on this fork.

Example

use serde::{Serialize, Deserialize};
use std::time::{Duration, SystemTime};

#[derive(Serialize, Deserialize)]
struct Foo {
    #[serde(with = "humantime_serde")]
    timeout: Duration,
    #[serde(default)]
    #[serde(with = "humantime_serde")]
    time: Option<SystemTime>,
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–1MB
~21K SLoC