pub enum SemverErrorKind {
MaxLengthError,
IncompleteInput,
ParseIntError(ParseIntError),
MaxIntError(u64),
Context(&'static str),
NoValidRanges,
Other,
}
Expand description
The specific kind of error that occurred. Usually wrapped in a SemverError.
Variants§
MaxLengthError
Semver strings overall can’t be longer than MAX_LENGTH. This is a
restriction coming from the JavaScript node-semver
.
IncompleteInput
Input to node-semver
must be “complete”. That is, a version must be
composed of major, minor, and patch segments, with optional prerelease
and build metadata. If you’re looking for alternative syntaxes, like 1.2
,
that are meant for defining semver ranges, use Range instead.
ParseIntError(ParseIntError)
Components of a semver string (major, minor, patch, integer sections of build and prerelease) must all be valid, parseable integers. This error occurs when Rust’s own integer parsing failed.
MaxIntError(u64)
node-semver
inherits the JavaScript implementation’s limitation on
limiting integer component sizes to MAX_SAFE_INTEGER.
Context(&'static str)
This is a generic error that a certain component of the semver string failed to parse.
NoValidRanges
This error happens only when all of the range is invalid.
Other
This error is mostly nondescript. Feel free to file an issue if you run into it.
Trait Implementations§
Source§impl Clone for SemverErrorKind
impl Clone for SemverErrorKind
Source§fn clone(&self) -> SemverErrorKind
fn clone(&self) -> SemverErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SemverErrorKind
impl Debug for SemverErrorKind
Source§impl Diagnostic for SemverErrorKind
impl Diagnostic for SemverErrorKind
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moreSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
Diagnostic
s.