use std::{io, result};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),
#[error("参数非法: {0}")]
InvalidArgument(String),
#[error("ERR index already exists")]
IndexExists,
#[error("配置非法: {0}")]
InvalidConfig(String),
#[error("快照失败: {0}")]
Snapshot(String),
#[error("恢复失败: {0}")]
Recovery(String),
#[error("BfTree 实例已被释放")]
Disposed,
#[error("扫描终止")]
ScanAborted,
#[error("数据损坏: {0}")]
Corrupted(String),
}
pub type Result<T> = result::Result<T, Error>;