Enum nextver::FormatError
source · #[non_exhaustive]pub enum FormatError {
UnterminatedSpecifier {
pattern: String,
},
UnacceptableSpecifier {
spec: String,
scheme_name: &'static str,
},
SpecifiersMustStepDecrease {
prev: String,
next: String,
},
WrongFirstSpecifier {
first_spec: String,
scheme_name: &'static str,
expected_first: String,
},
Incomplete {
last_spec: String,
scheme_name: &'static str,
expected_last: String,
},
NoSpecifiersInFormat,
}
Expand description
An error that occurred while parsing a format string.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnterminatedSpecifier
The specifier is not terminated with a closing bracket.
UnacceptableSpecifier
The specifier is not a valid specifier for the scheme
SpecifiersMustStepDecrease
Two adjacent specifiers were not decreasing or decreased by more than one “step”. In other words, the specifiers are not in the correct order of significance.
§Examples
<MAJOR><MAJOR>
: not decreasing<MAJOR><MINOR><PATCH><MINOR>
: last minor does not decrease<YYYY><DD>
: decreasing by more than one step (days are only relative to months)
WrongFirstSpecifier
Fields
The first specifier in a format is not allowed to be there
Incomplete
Fields
The last specifier in a format does not complete the format
NoSpecifiersInFormat
The format string should contain at least one specifier
Trait Implementations§
source§impl Debug for FormatError
impl Debug for FormatError
source§impl Display for FormatError
impl Display for FormatError
source§impl Error for FormatError
impl Error for FormatError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<FormatError> for CompositeError
impl From<FormatError> for CompositeError
source§fn from(source: FormatError) -> Self
fn from(source: FormatError) -> Self
Converts to this type from the input type.
source§impl PartialEq for FormatError
impl PartialEq for FormatError
source§fn eq(&self, other: &FormatError) -> bool
fn eq(&self, other: &FormatError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for FormatError
Auto Trait Implementations§
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnwindSafe for FormatError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more