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

#43 in Encoding

Download history 79280/week @ 2023-12-14 50651/week @ 2023-12-21 56374/week @ 2023-12-28 80245/week @ 2024-01-04 91780/week @ 2024-01-11 102675/week @ 2024-01-18 91257/week @ 2024-01-25 92176/week @ 2024-02-01 92574/week @ 2024-02-08 89576/week @ 2024-02-15 95652/week @ 2024-02-22 112213/week @ 2024-02-29 122963/week @ 2024-03-07 140017/week @ 2024-03-14 117726/week @ 2024-03-21 75992/week @ 2024-03-28

479,076 downloads per month
Used in 292 crates (111 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.5–1MB
~24K SLoC