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: LocThe code location of the diagnostic.
level: LevelThe level of the diagnostic.
ty: ErrorTypeThe type of diagnostic.
message: StringThe 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<Diagnostic> for Diagnostic
impl PartialEq<Diagnostic> 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<Diagnostic> for Diagnostic
impl PartialOrd<Diagnostic> 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 more