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

Trait Implementations

Derived Implementations

impl Debug for Report

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Eq for Report

impl PartialEq for Report

fn eq(&self, __arg_0: &Report) -> bool

fn ne(&self, __arg_0: &Report) -> bool

impl Clone for Report

fn clone(&self) -> Report

fn clone_from(&mut self, source: &Self)