#serde #time #duration #humantime

humantime-serde

Serde support for the humantime crate

3 releases (1 stable)

✓ Uses Rust 2018 edition

1.0.0 Jan 29, 2020
0.1.1 May 24, 2019
0.1.0 May 24, 2019

#124 in Encoding

Download history 195/week @ 2019-12-10 366/week @ 2019-12-17 321/week @ 2019-12-24 108/week @ 2019-12-31 227/week @ 2020-01-07 175/week @ 2020-01-14 361/week @ 2020-01-21 725/week @ 2020-01-28 303/week @ 2020-02-04 452/week @ 2020-02-11 733/week @ 2020-02-18 1842/week @ 2020-02-25 1982/week @ 2020-03-03 1840/week @ 2020-03-10 1911/week @ 2020-03-17 1409/week @ 2020-03-24

1,461 downloads per month
Used in 11 crates (9 directly)

MIT/Apache

13KB
279 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.7–1.1MB
~25K SLoC