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

#39 in Encoding

Download history 279294/week @ 2024-10-08 286041/week @ 2024-10-15 307339/week @ 2024-10-22 292279/week @ 2024-10-29 307641/week @ 2024-11-05 303455/week @ 2024-11-12 298703/week @ 2024-11-19 223361/week @ 2024-11-26 267150/week @ 2024-12-03 341866/week @ 2024-12-10 261160/week @ 2024-12-17 104150/week @ 2024-12-24 188509/week @ 2024-12-31 336809/week @ 2025-01-07 332689/week @ 2025-01-14 241275/week @ 2025-01-21

1,123,842 downloads per month
Used in 413 crates (143 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
~21K SLoC