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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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>>
Unique diagnostic code that can be used to look up more information
about this 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 more
sourcefn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Additional help text related to this Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue? Read more
sourcefn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
URL to visit for a more detailed explanation/help about this
Diagnostic
. Read more
sourcefn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandler
s to change the display format
of this diagnostic. Read more
sourcefn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this 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>>
Labels to apply to this Diagnostic
’s Diagnostic::source_code
Additional related Diagnostic
s.
sourcefn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
The cause of the error.
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)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl PartialEq<SemverErrorKind> for SemverErrorKind
impl PartialEq<SemverErrorKind> for SemverErrorKind
sourcefn eq(&self, other: &SemverErrorKind) -> bool
fn eq(&self, other: &SemverErrorKind) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Eq for SemverErrorKind
impl StructuralEq for SemverErrorKind
impl StructuralPartialEq for SemverErrorKind
Auto Trait Implementations
impl RefUnwindSafe for SemverErrorKind
impl Send for SemverErrorKind
impl Sync for SemverErrorKind
impl Unpin for SemverErrorKind
impl UnwindSafe for SemverErrorKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more