#[non_exhaustive]pub enum ParseVersionError {
Empty,
MissingComponent {
component: &'static str,
},
InvalidNumber {
component: &'static str,
},
LeadingZero {
component: &'static str,
},
InvalidIdentifier,
InvalidComparator,
}Expand description
Why a version or a version requirement could not be parsed.
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.
Empty
The text is empty or only whitespace.
MissingComponent
A part is missing: "1.2" has no patch.
InvalidNumber
A part is not a number (or does not fit a u64).
LeadingZero
A number has a leading zero ("01"), which semver forbids.
InvalidIdentifier
A pre-release or build identifier is empty or has a character outside [0-9A-Za-z-].
InvalidComparator
A requirement comparator is malformed: unknown operator, a wildcard where it is not allowed, a pre-release on a partial version, or build metadata.
Trait Implementations§
Source§impl Clone for ParseVersionError
impl Clone for ParseVersionError
Source§impl Debug for ParseVersionError
impl Debug for ParseVersionError
Source§impl Display for ParseVersionError
impl Display for ParseVersionError
impl Eq for ParseVersionError
Source§impl Error for ParseVersionError
impl Error for ParseVersionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 PartialEq for ParseVersionError
impl PartialEq for ParseVersionError
impl StructuralPartialEq for ParseVersionError
Auto Trait Implementations§
impl Freeze for ParseVersionError
impl RefUnwindSafe for ParseVersionError
impl Send for ParseVersionError
impl Sync for ParseVersionError
impl Unpin for ParseVersionError
impl UnsafeUnpin for ParseVersionError
impl UnwindSafe for ParseVersionError
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