#serde #time #duration #humantime

humantime-serde

Serde support for the humantime crate

4 releases (2 stable)

1.0.1 Sep 14, 2020
1.0.0 Jan 29, 2020
0.1.1 May 24, 2019
0.1.0 May 24, 2019

#69 in Encoding

Download history 2176/week @ 2020-06-09 2372/week @ 2020-06-16 2585/week @ 2020-06-23 2480/week @ 2020-06-30 2746/week @ 2020-07-07 3317/week @ 2020-07-14 3372/week @ 2020-07-21 3973/week @ 2020-07-28 4138/week @ 2020-08-04 4135/week @ 2020-08-11 5013/week @ 2020-08-18 4607/week @ 2020-08-25 3827/week @ 2020-09-01 4827/week @ 2020-09-08 5765/week @ 2020-09-15 5051/week @ 2020-09-22

17,089 downloads per month
Used in 21 crates (15 directly)

MIT/Apache

13KB
282 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.6–1.2MB
~28K SLoC