Skip to main content

deserialize_seconds_as_duration

Function deserialize_seconds_as_duration 

Source
pub fn deserialize_seconds_as_duration<'de, D>(
    deserializer: D,
) -> Result<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 parsed as an integer