Struct solang_parser::diagnostics::Diagnostic
source · pub struct Diagnostic {
pub loc: Loc,
pub level: Level,
pub ty: ErrorType,
pub message: String,
pub notes: Vec<Note>,
}
Expand description
A Solidity diagnostic.
Fields§
§loc: Loc
The code location of the diagnostic.
level: Level
The level of the diagnostic.
ty: ErrorType
The type of diagnostic.
message: String
The message of the diagnostic.
notes: Vec<Note>
Extra notes about the diagnostic.
Implementations§
source§impl Diagnostic
impl Diagnostic
sourcepub fn debug(loc: Loc, message: String) -> Self
pub fn debug(loc: Loc, message: String) -> Self
Instantiate a new Diagnostic with the given location and message at the debug level.
sourcepub fn info(loc: Loc, message: String) -> Self
pub fn info(loc: Loc, message: String) -> Self
Instantiate a new Diagnostic with the given location and message at the info level.
sourcepub fn parser_error(loc: Loc, message: String) -> Self
pub fn parser_error(loc: Loc, message: String) -> Self
Instantiate a new parser error Diagnostic.
sourcepub fn decl_error(loc: Loc, message: String) -> Self
pub fn decl_error(loc: Loc, message: String) -> Self
Instantiate a new declaration error Diagnostic.
sourcepub fn cast_error(loc: Loc, message: String) -> Self
pub fn cast_error(loc: Loc, message: String) -> Self
Instantiate a new cast error error Diagnostic.
sourcepub fn cast_error_with_note(
loc: Loc,
message: String,
note_loc: Loc,
note: String
) -> Self
pub fn cast_error_with_note( loc: Loc, message: String, note_loc: Loc, note: String ) -> Self
Instantiate a new cast error error Diagnostic, with a note.
sourcepub fn type_error(loc: Loc, message: String) -> Self
pub fn type_error(loc: Loc, message: String) -> Self
Instantiate a new type error error Diagnostic.
sourcepub fn cast_warning(loc: Loc, message: String) -> Self
pub fn cast_warning(loc: Loc, message: String) -> Self
Instantiate a new cast error Diagnostic at the warning level.
sourcepub fn warning_with_note(
loc: Loc,
message: String,
note_loc: Loc,
note: String
) -> Self
pub fn warning_with_note( loc: Loc, message: String, note_loc: Loc, note: String ) -> Self
Instantiate a new warning Diagnostic, with a note.
sourcepub fn warning_with_notes(loc: Loc, message: String, notes: Vec<Note>) -> Self
pub fn warning_with_notes(loc: Loc, message: String, notes: Vec<Note>) -> Self
Instantiate a new warning Diagnostic, with multiple notes.
Trait Implementations§
source§impl Clone for Diagnostic
impl Clone for Diagnostic
source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a copy 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 Diagnostic
impl Debug for Diagnostic
source§impl Hash for Diagnostic
impl Hash for Diagnostic
source§impl Ord for Diagnostic
impl Ord for Diagnostic
source§fn cmp(&self, other: &Diagnostic) -> Ordering
fn cmp(&self, other: &Diagnostic) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Diagnostic
impl PartialOrd for Diagnostic
source§fn partial_cmp(&self, other: &Diagnostic) -> Option<Ordering>
fn partial_cmp(&self, other: &Diagnostic) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Diagnostic
impl StructuralEq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
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