Enum node_semver::SemverErrorKind
source · [−]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
Other
This error is mostly nondescript. Feel free to file an issue if you run into it.
Trait Implementations
sourceimpl Clone for SemverErrorKind
impl Clone for SemverErrorKind
sourcefn clone(&self) -> SemverErrorKind
fn clone(&self) -> SemverErrorKind
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for SemverErrorKind
impl Debug for SemverErrorKind
sourceimpl Diagnostic for SemverErrorKind
impl Diagnostic for SemverErrorKind
sourcefn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
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. Read moresourcefn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue? Read moresourcefn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic
. Read moresourcefn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moresourcefn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.sourcefn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>, Global>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>, Global>>
Diagnostic
’s Diagnostic::source_code
Diagnostic
s.sourcefn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
sourceimpl Display for SemverErrorKind
impl Display for SemverErrorKind
sourceimpl Error for SemverErrorKind
impl Error for SemverErrorKind
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()