Skip to main content

deserialize_optional_seconds_as_duration

Function deserialize_optional_seconds_as_duration 

Source
pub fn deserialize_optional_seconds_as_duration<'de, D>(
    deserializer: D,
) -> Result<Option<Duration>, D::Error>
where D: Deserializer<'de>,
Expand description

deserialize an integer as a time::Duration where the integer represents seconds

ยงErrors

returns an error if the value can not be interpreted as null or an integer