Skip to main content

parse_duration

Function parse_duration 

Source
pub fn parse_duration(raw: &str) -> Result<Duration, String>
Expand description

Parse a duration of one positive whole number followed by exactly one unit: d, h, m or s (e.g. 30d, 12h). Hand-rolled on purpose. The workspace has no humantime, and a horizon never needs compound or fractional forms.