Skip to main content

parse_duration_dhm

Function parse_duration_dhm 

Source
pub fn parse_duration_dhm(s: &str) -> Option<Duration>
Expand description

Parse a duration string with a d (days), h (hours), or m (minutes) integer suffix.

  • Input is trimmed before parsing.
  • The numeric value must be a positive integer (> 0).
  • Arithmetic uses checked_mul so overflow returns None.
  • Returns None for any input that doesn’t match the grammar.