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

#45 in Encoding

Download history 87941/week @ 2024-01-09 101613/week @ 2024-01-16 95556/week @ 2024-01-23 89934/week @ 2024-01-30 94746/week @ 2024-02-06 88339/week @ 2024-02-13 94303/week @ 2024-02-20 101829/week @ 2024-02-27 115283/week @ 2024-03-05 143159/week @ 2024-03-12 131450/week @ 2024-03-19 92544/week @ 2024-03-26 98081/week @ 2024-04-02 96207/week @ 2024-04-09 103928/week @ 2024-04-16 96126/week @ 2024-04-23

410,410 downloads per month
Used in 303 crates (114 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