aada 0.1.0

纯 Rust 的 2D 骨骼动画引擎,兼容 Spine 4.x 导出格式(JSON + atlas)。求解到分层 Mesh 与各 Mesh 渲染设置为止,之后交给渲染器。
Documentation
//! 引擎统一错误类型。

use std::fmt::Display;

/// 引擎错误
#[derive(Debug, PartialEq, Eq)]
pub enum Error {
    /// 数据非法(解析失败、引用不存在的骨骼/slot/皮肤等)
    InvalidData(String),
    /// 索引非法(越界或容器处于无效状态)
    InvalidIndex(String),
}

impl Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Error::InvalidData(msg) => write!(f, "Invalid data: {}", msg),
            Error::InvalidIndex(msg) => write!(f, "Invalid index: {}", msg),
        }
    }
}

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