Expand description
Convenience module to allow serialization via humantime_serde
for Option
§Example
use serde::{Serialize, Deserialize};
use std::time::{Duration, SystemTime};
#[derive(Serialize, Deserialize)]
struct Foo {
#[serde(with = "humantime_serde::option")]
timeout: Option<Duration>,
#[serde(default)]
#[serde(with = "humantime_serde::option")]
time: Option<SystemTime>,
}
Functions§
- Deserialize an
Option<Duration>
orOption<SystemTime>
- Serializes an
Option<Duration>
orOption<SystemTime>