Struct node_semver::SemverError
source · [−]pub struct SemverError { /* private fields */ }
Expand description
Semver version or range parsing error wrapper.
This wrapper is used to hold some parsing-related metadata, as well as a more specific SemverErrorKind.
Implementations
sourceimpl SemverError
impl SemverError
sourcepub fn span(&self) -> &SourceSpan
pub fn span(&self) -> &SourceSpan
Returns the SourceSpan of the error.
sourcepub fn offset(&self) -> usize
pub fn offset(&self) -> usize
Returns the (0-based) byte offset where the parsing error happened.
sourcepub fn kind(&self) -> &SemverErrorKind
pub fn kind(&self) -> &SemverErrorKind
Returns the more specific SemverErrorKind for this error.
This value can also be fetched through std::error::Error::source, but that would require downcasting to match types.
Trait Implementations
sourceimpl Clone for SemverError
impl Clone for SemverError
sourcefn clone(&self) -> SemverError
fn clone(&self) -> SemverError
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 moresourceimpl Debug for SemverError
impl Debug for SemverError
sourceimpl Diagnostic for SemverError
impl Diagnostic for SemverError
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 moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn 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> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
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 SemverError
impl Display for SemverError
sourceimpl Error for SemverError
impl Error for SemverError
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
👎Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl PartialEq<SemverError> for SemverError
impl PartialEq<SemverError> for SemverError
sourcefn eq(&self, other: &SemverError) -> bool
fn eq(&self, other: &SemverError) -> bool
impl Eq for SemverError
impl StructuralEq for SemverError
impl StructuralPartialEq for SemverError
Auto Trait Implementations
impl RefUnwindSafe for SemverError
impl Send for SemverError
impl Sync for SemverError
impl Unpin for SemverError
impl UnwindSafe for SemverError
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