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 228081/week @ 2024-08-24 226519/week @ 2024-08-31 247912/week @ 2024-09-07 216441/week @ 2024-09-14 258616/week @ 2024-09-21 250523/week @ 2024-09-28 289937/week @ 2024-10-05 272895/week @ 2024-10-12 298698/week @ 2024-10-19 304728/week @ 2024-10-26 301829/week @ 2024-11-02 307966/week @ 2024-11-09 297580/week @ 2024-11-16 237062/week @ 2024-11-23 243007/week @ 2024-11-30 289441/week @ 2024-12-07

1,117,774 downloads per month
Used in 389 crates (135 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
~22K SLoC