dictx-core 0.1.0

Core data types and query models for DictX terminal dictionary.
Documentation
use thiserror::Error;

pub type Result<T> = std::result::Result<T, DictxError>;

#[derive(Debug, Error)]
pub enum DictxError {
    #[error("IO 错误: {0}")]
    Io(#[from] std::io::Error),

    #[error("CSV 解析错误: {0}")]
    Csv(#[from] csv::Error),

    #[error("JSON 解析错误: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Tantivy 索引错误: {0}")]
    Tantivy(String),

    #[error("配置错误: {0}")]
    Config(String),

    #[error("数据源不支持或不可用: {0}")]
    UnsupportedSource(String),

    #[error("数据格式错误: {0}")]
    InvalidData(String),

    #[error("{0}")]
    Message(String),
}