pub trait ErrorDisplay {
    // Required methods
    fn core(&self) -> &ErrorCore;
    fn input(&self) -> &Input;
    fn caused_by(&self) -> &str;
    fn ref_inner(&self) -> Option<&Self>;

    // Provided methods
    fn write_to_stderr(&self) { ... }
    fn write_to<W: Write>(&self, w: &mut W) { ... }
    fn show(&self) -> String { ... }
    fn format(&self, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description

format:

Error[#{.errno}]: File {file}, line {.loc (as line)}, in {.caused_by}

{.loc (as line)}| {src}
{offset}        : {pointer}
{offset}        :         {sub_msgs}
{offset}        :         {.hint}

{.kind}: {.desc}

example:

Error[#2223]: File <stdin>, line 1, in <module>

1 │ 100 = i
  · ---
  ·   │─ sub_msg1: first sub message here
  ·   │─ sub_msg2: second sub message here
  ·   ╰─ hint: hint message here

SyntaxError: cannot assign to 100

Required Methods§

source

fn core(&self) -> &ErrorCore

source

fn input(&self) -> &Input

source

fn caused_by(&self) -> &str

The block name the error caused. This will be None if the error occurred before semantic analysis.

source

fn ref_inner(&self) -> Option<&Self>

the previous error that caused this error.

Provided Methods§

source

fn write_to_stderr(&self)

source

fn write_to<W: Write>(&self, w: &mut W)

source

fn show(&self) -> String

source

fn format(&self, f: &mut Formatter<'_>) -> Result

for fmt::Display

Implementors§