Parse a string for an exact match against the format. The entire string must match the format pattern. Returns None if the string does not match. # Arguments `input` - The string to parse # Returns Some(ParseResult) on success, None if no match.
(&self, input: &str)
| 199 | /// # Returns |
| 200 | /// Some(ParseResult) on success, None if no match. |
| 201 | pub fn parse(&self, input: &str) -> Option<ParseResult> { |
| 202 | let captures = self.match_re.captures(input)?; |
| 203 | self.try_evaluate_captures(&captures, input, 0).ok().flatten() |
| 204 | } |
| 205 | |
| 206 | pub fn parse_with_error(&self, input: &str) -> Result<Option<ParseResult>, String> { |
| 207 | let captures = match self.match_re.captures(input) { |