error-engine 0.1.0

A message catalog + presentation layer on top of thiserror and tracing for consistent error/warning/info rendering.
Documentation
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Severity {
    Error,
    Warning,
    Info,
}

/// Every "diagnosable" error/warning/info in the project implements this.
/// `code()` is the key looked up in the project's TOML catalog.
pub trait EngineDiagnostic: fmt::Debug {
    fn code(&self) -> &'static str;
    fn severity(&self) -> Severity;

    /// Dynamic values to interpolate into the catalog template,
    /// e.g. [("path", "/etc/config.toml")]
    fn context(&self) -> Vec<(&'static str, String)> {
        Vec::new()
    }
}