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 |
#41 in Encoding
979,202 downloads per month
Used in 358 crates
(123 directly)
15KB
301 lines
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
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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
~24K SLoC