pub struct NoteError {
pub kind: Box<NoteErrorKind>,
pub level: DiagnosticLevel,
pub file: Option<Url>,
pub range: Option<Range<usize>>,
}
Expand description
Error type for all Notedown operators
Fields§
§kind: Box<NoteErrorKind>
Actual error kind
level: DiagnosticLevel
Error level for report
file: Option<Url>
File name where error occurred
range: Option<Range<usize>>
Range offset where error occurred
Implementations§
Source§impl NoteError
impl NoteError
Sourcepub fn unreachable() -> Self
pub fn unreachable() -> Self
Constructor of NoteErrorKind::Unreachable
Sourcepub fn undefined_variable(name: impl Into<String>) -> NoteError
pub fn undefined_variable(name: impl Into<String>) -> NoteError
Constructor of NoteErrorKind::UndefinedVariable
Source§impl NoteError
impl NoteError
Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Deprecated or obsolete code. Clients are allowed to rendered diagnostics with this tag strike through.
Sourcepub fn is_unnecessary(&self) -> bool
pub fn is_unnecessary(&self) -> bool
Unused or unnecessary code. Clients are allowed to render diagnostics with this tag faded out instead of having an error squiggle.
Source§impl NoteError
impl NoteError
Sourcepub fn syntax_error(msg: impl Into<String>) -> NoteError
pub fn syntax_error(msg: impl Into<String>) -> NoteError
Constructor of [NoteErrorKind::$t
]
Sourcepub fn type_mismatch(msg: impl Into<String>) -> NoteError
pub fn type_mismatch(msg: impl Into<String>) -> NoteError
Constructor of [NoteErrorKind::$t
]
Sourcepub fn runtime_error(msg: impl Into<String>) -> NoteError
pub fn runtime_error(msg: impl Into<String>) -> NoteError
Constructor of [NoteErrorKind::$t
]
Source§impl NoteError
impl NoteError
Get the tags as DiagnosticTag
Sourcepub fn as_lsp_diagnostic(&self, text: &TextIndex) -> Diagnostic
pub fn as_lsp_diagnostic(&self, text: &TextIndex) -> Diagnostic
Convert error to lsp Diagnostic
Trait Implementations§
Source§impl Error for NoteError
impl Error for NoteError
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<R> From<ErrorVariant<R>> for NoteErrorwhere
R: Debug,
impl<R> From<ErrorVariant<R>> for NoteErrorwhere
R: Debug,
Source§fn from(e: ErrorVariant<R>) -> Self
fn from(e: ErrorVariant<R>) -> Self
Converts to this type from the input type.
Source§impl From<Infallible> for NoteError
impl From<Infallible> for NoteError
Source§fn from(_: Infallible) -> Self
fn from(_: Infallible) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for NoteError
impl From<ParseError> for NoteError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for NoteError
impl From<ParseError> for NoteError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NoteError
impl !RefUnwindSafe for NoteError
impl Send for NoteError
impl Sync for NoteError
impl Unpin for NoteError
impl !UnwindSafe for NoteError
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