tauri-runtime-servocat 0.2.0

Servo-replacement runtime for Tauri: wires html-cat, css-cat, dom-cat, layout-cat, paint-cat, net-cat, boa-cat, ecma-runtime-cat, and web-api-cat into a single rendering + scripting pipeline. v0.2.0 adds a tiny-skia rasterizer (FillRect + StrokeRect; FillText placeholder until v0.3 cosmic-text). The cosmic-text shaping, winit window, IPC bridge, and tauri_runtime::Runtime trait impl are committed-to deliverables for subsequent versions. The Servo no-AI policy disqualifies upstream contribution; this is the AI-built parallel.
//! Meta-crate error type.

use boa_cat::Error as EngineError;
use css_cat::Error as CssError;
use html_cat::Error as HtmlError;
use web_api_cat::Error as WebApiError;

/// All errors `tauri-runtime-servocat` can produce.  Most variants wrap
/// errors from the underlying cat-stack crates.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
    /// An HTML-parser error.
    Html(HtmlError),
    /// A CSS-parser error.
    Css(CssError),
    /// A JS engine error.
    Engine(EngineError),
    /// A web-api bridge error.
    WebApi(WebApiError),
}

impl From<HtmlError> for Error {
    fn from(value: HtmlError) -> Self {
        Self::Html(value)
    }
}

impl From<CssError> for Error {
    fn from(value: CssError) -> Self {
        Self::Css(value)
    }
}

impl From<EngineError> for Error {
    fn from(value: EngineError) -> Self {
        Self::Engine(value)
    }
}

impl From<WebApiError> for Error {
    fn from(value: WebApiError) -> Self {
        Self::WebApi(value)
    }
}

impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Html(e) => write!(f, "html error: {e}"),
            Self::Css(e) => write!(f, "css error: {e}"),
            Self::Engine(e) => write!(f, "engine error: {e}"),
            Self::WebApi(e) => write!(f, "web-api error: {e}"),
        }
    }
}

impl std::error::Error for Error {}