Skip to main content

parse_duration_number

Function parse_duration_number 

Source
fn parse_duration_number<T: FromStr>(
    number: &str,
    unit: &'static str,
) -> Result<T, IntervalDayError>
Expand description

Parse the integer part of a duration term, e.g. the -5 of -5d.

The grammar guarantees an optionally-signed run of digits, so the only way this can fail is a value too large for the protobuf field it is stored in.