Skip to main content

EngineDiagnostic

Trait EngineDiagnostic 

Source
pub trait EngineDiagnostic: Debug {
    // Required methods
    fn code(&self) -> &'static str;
    fn severity(&self) -> Severity;

    // Provided method
    fn context(&self) -> Vec<(&'static str, String)> { ... }
}
Expand description

Every “diagnosable” error/warning/info in the project implements this. code() is the key looked up in the project’s TOML catalog.

Required Methods§

Source

fn code(&self) -> &'static str

Source

fn severity(&self) -> Severity

Provided Methods§

Source

fn context(&self) -> Vec<(&'static str, String)>

Dynamic values to interpolate into the catalog template, e.g. [(“path”, “/etc/config.toml”)]

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§