Struct xswag_base::diag::Report
[−]
[src]
pub struct Report { pub kind: ReportKind, pub span: Option<Span>, pub remarks: Vec<Remark>, }
Describes some kind of problem or occurrence in the code. Contains one or more remarks with descriptions and separate code spans.
This type doesn't provide a Display
impl, since all spans reference an
external filemap which needs to be provided. Use print
methods of the
diag
module instead.
Fields
kind | Kind of the report (usually the same as the first remark kind) |
span | Span of the main code snippet |
remarks | List of remarks describing the report |
Methods
impl Report
fn simple_error<S: Into<String>>(msg: S, span: Span) -> Report
Creates a error report with one message and one span
fn simple_spanless_error<S: Into<String>>(msg: S) -> Report
Creates a error report with one message, but without span
fn simple_warning<S: Into<String>>(msg: S, span: Span) -> Report
Creates a warning report with one message and one span
fn with_note<S: Into<String>>(self, msg: S) -> Report
Adds a note without a span/code snippet to the existing Report
fn with_span_note<S: Into<String>>(self, msg: S, span: Span) -> Report
Adds a note with a span/code snippet to the existing Report
fn with_remark(self, rem: Remark) -> Report
Adds a remark to the returned Report