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

#41 in Encoding

Download history 182671/week @ 2024-06-13 171431/week @ 2024-06-20 195514/week @ 2024-06-27 164911/week @ 2024-07-04 170417/week @ 2024-07-11 183395/week @ 2024-07-18 198940/week @ 2024-07-25 186819/week @ 2024-08-01 209042/week @ 2024-08-08 218148/week @ 2024-08-15 220262/week @ 2024-08-22 217297/week @ 2024-08-29 251640/week @ 2024-09-05 233120/week @ 2024-09-12 244075/week @ 2024-09-19 202215/week @ 2024-09-26

979,202 downloads per month
Used in 358 crates (123 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.4–1MB
~24K SLoC