humantime_serde

Function serialize

Source
pub fn serialize<T, S>(d: &T, s: S) -> Result<S::Ok, S::Error>
where for<'a> Serde<&'a T>: Serialize, S: Serializer,
Expand description

Serializes a Duration or SystemTime via the humantime crate.

This function can be used with serde_derive’s with and serialize_with annotations.