pub struct SourceError<L> {
pub message: String,
pub span: SourceSpan,
/* private fields */
}Expand description
Report a source error: text of the language L that cannot be read, left out of the model.
Fields§
§message: String§span: SourceSpanTrait Implementations§
Source§impl<L: Clone> Clone for SourceError<L>
impl<L: Clone> Clone for SourceError<L>
Source§impl<L: Debug> Debug for SourceError<L>
impl<L: Debug> Debug for SourceError<L>
Source§impl<L: SourceLanguage> Diagnostic for SourceError<L>
impl<L: SourceLanguage> Diagnostic for SourceError<L>
Source§fn 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.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn 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_codeSource§fn 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?Source§fn 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.Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this
Diagnostic’s Diagnostic::labels to.Additional related
Diagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
The cause of the error.
Source§impl<L> Display for SourceError<L>
impl<L> Display for SourceError<L>
impl<L: Eq> Eq for SourceError<L>
Source§impl<L: Debug> Error for SourceError<L>
impl<L: Debug> Error for SourceError<L>
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<L: PartialEq> PartialEq for SourceError<L>
impl<L: PartialEq> PartialEq for SourceError<L>
impl<L: PartialEq> StructuralPartialEq for SourceError<L>
Auto Trait Implementations§
impl<L> Forget for SourceError<L>
impl<L> Freeze for SourceError<L>where
PhantomData<L>: Freeze,
impl<L> Move for SourceError<L>
impl<L> RefUnwindSafe for SourceError<L>where
PhantomData<L>: RefUnwindSafe,
impl<L> Send for SourceError<L>where
PhantomData<L>: Send,
impl<L> Sync for SourceError<L>where
PhantomData<L>: Sync,
impl<L> Unpin for SourceError<L>where
PhantomData<L>: Unpin,
impl<L> UnsafeUnpin for SourceError<L>where
PhantomData<L>: UnsafeUnpin,
impl<L> UnwindSafe for SourceError<L>where
PhantomData<L>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<D> ErrorSeverity for Dwhere
D: Diagnostic + ?Sized,
impl<D> ErrorSeverity for Dwhere
D: Diagnostic + ?Sized,
Source§impl<D> LabelledDiagnostic for Dwhere
D: Diagnostic + ?Sized,
impl<D> LabelledDiagnostic for Dwhere
D: Diagnostic + ?Sized,
Source§fn first_label_offset(&self) -> Option<usize>
fn first_label_offset(&self) -> Option<usize>
Return where the diagnostic’s first label starts, or
None when it has no label.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.