add get_example_... functions, parse_and_keep_raw_input function

This commit is contained in:
Vlasislav Kashin
2025-07-09 18:52:52 +03:00
parent 1307c8cbba
commit 91719e110d
2 changed files with 190 additions and 25 deletions

View File

@@ -32,7 +32,9 @@ pub enum ParseError {
#[error("{0}")]
InvalidRegexError(#[from] ErrorInvalidRegex),
#[error("{0}")]
ParseNumberAsIntError(#[from] ParseIntError)
ParseNumberAsIntError(#[from] ParseIntError),
#[error("{0}")]
ExtractNumberError(#[from] ExtractNumberError),
}
#[derive(Debug, PartialEq, Error)]
@@ -43,3 +45,16 @@ pub enum ExtractNumberError {
NotANumber,
}
#[derive(Debug, PartialEq, Error)]
pub enum GetExampleNumberError {
#[error("Parse error: {0}")]
ParseError(#[from] ParseError),
#[error("{0}")]
InvalidRegexError(#[from] ErrorInvalidRegex),
#[error("No example number")]
NoExampleNumberError,
#[error("Could not get number")]
CouldNotGetNumberError,
#[error("Invalid metadata")]
InvalidMetadataError
}