parse

Function parse 

Source
pub fn parse(s: &str) -> Result<Duration, ParseDurationError>
Expand description

Parse a Duration from a string in the compose-spec duration format.

See the module documentation for more details on the format.

§Errors

Returns an error if the input is an empty string, does not contain ASCII digits (0-9), contains an invalid unit (valid units: “h”, “m”, “s”, “ms”, “us”), or the value is too large for a Duration.