pub fn parse_duration(input: &str) -> Result<Duration, ParseDurationError>
Expand description

Parses a duration from a string.

The input string is specified as an integer followed immediately by one of the following units:

  • ms - milliseconds
  • s - seconds
  • m - minutes
  • h - hours
  • d - days
  • w - weeks

Units must be ordered from the longest to the shortest, and a given unit must only appear once in a time duration.