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 299215/week @ 2024-11-15 254019/week @ 2024-11-22 234898/week @ 2024-11-29 326255/week @ 2024-12-06 312530/week @ 2024-12-13 131404/week @ 2024-12-20 131876/week @ 2024-12-27 297420/week @ 2025-01-03 368199/week @ 2025-01-10 290102/week @ 2025-01-17 311952/week @ 2025-01-24 320619/week @ 2025-01-31 341534/week @ 2025-02-07 309457/week @ 2025-02-14 389810/week @ 2025-02-21 299993/week @ 2025-02-28

1,403,120 downloads per month
Used in 428 crates (146 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