pub struct SyntaxError {
pub span: Span,
pub message: EcoString,
pub hints: EcoVec<EcoString>,
pub notes: EcoVec<EcoString>,
pub label_message: Option<EcoString>,
pub labels: EcoVec<Label>,
pub code: Option<&'static ErrorCode>,
pub fixes: EcoVec<Fix>,
pub severity: SyntaxErrorSeverity,
}
Expand description
A syntactical error.
Fields§
§span: Span
The node’s span.
message: EcoString
The error message.
hints: EcoVec<EcoString>
Additional hints to the user, indicating how this error could be avoided or worked around.
notes: EcoVec<EcoString>
Additional notes to the user, indicating more details about the error.
label_message: Option<EcoString>
A message to be displayed as a label for the error. This message is shown at the location of the error and can give more locational information
labels: EcoVec<Label>
Related labels that provide additional information.
code: Option<&'static ErrorCode>
§fixes: EcoVec<Fix>
§severity: SyntaxErrorSeverity
Implementations§
Source§impl SyntaxError
impl SyntaxError
pub fn with_message(&mut self, message: impl Into<EcoString>) -> &mut Self
pub fn with_note(&mut self, note: impl Into<EcoString>) -> &mut Self
pub fn with_hint(&mut self, hint: impl Into<EcoString>) -> &mut Self
pub fn with_label_message(&mut self, message: impl Into<EcoString>) -> &mut Self
pub fn with_label(&mut self, label: Label) -> &mut Self
pub fn with_code(&mut self, code: &'static ErrorCode) -> &mut Self
pub fn with_severity(&mut self, severity: SyntaxErrorSeverity) -> &mut Self
pub fn with_fix(&mut self, fix: Fix) -> &mut Self
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SyntaxError
impl Debug for SyntaxError
Source§impl Hash for SyntaxError
impl Hash for SyntaxError
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
impl Eq for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnwindSafe for SyntaxError
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