Skip to main content

parse_duration_seconds

Function parse_duration_seconds 

Source
pub fn parse_duration_seconds(field: &str, value: &str) -> Result<u64>
Expand description

Parses a duration such as "90s", "10m", "24h" or "1h30m" into whole seconds.

Units are ms, s, m, h and d; each part is a whole number followed by its unit. A duration that is not a whole number of seconds ("1500ms") is rejected.