Recognizes an [`Epoch`] in a string slice. Consumes all of its input. # Errors Returns an error if `input` is not a valid _alpm_epoch_.
(input: &mut &str)
| 66 | } |
| 67 | } |
| 68 | |
| 69 | impl AlpmParser for Epoch { |
| 70 | /// Recognizes an [`Epoch`] in a string slice. |
| 71 | /// |
| 72 | /// # Errors |
| 73 | /// |
| 74 | /// Returns an error if `input` does not begin with a valid _alpm_epoch_. |
| 75 | fn parser<'a>(input: &mut Input<'a>) -> PResult<'a, Self> { |
| 76 | dec_uint |
| 77 | .expected_text("non-negative decimal integer") |
| 78 | .map(Self) |
| 79 | .layer("alpm-epoch") |
| 80 | .parse_next(input) |