chore: establish development baseline

This commit is contained in:
2026-06-28 01:27:09 +08:00
commit dd53e3054e
131 changed files with 19327 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
//! Binary Patch 模块占位
/// Binary Patch 应用(待实现)
pub fn apply_patch(_old: &[u8], _patch: &[u8]) -> crate::Result<Vec<u8>> {
Ok(Vec::new())
}
+22
View File
@@ -0,0 +1,22 @@
//! Patch 错误类型定义
use thiserror::Error;
/// Patch 错误类型
#[derive(Error, Debug)]
pub enum PatchError {
/// IO 错误
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// Patch 应用失败
#[error("Patch apply failed: {0}")]
ApplyFailed(String),
/// 其他错误
#[error(transparent)]
Other(#[from] anyhow::Error),
}
/// Patch Result 类型
pub type Result<T> = std::result::Result<T, PatchError>;
+6
View File
@@ -0,0 +1,6 @@
//! JSON Patch 模块占位
/// JSON Patch 应用(待实现)
pub fn apply_json_patch(_doc: &str, _patch: &str) -> crate::Result<String> {
Ok(String::new())
}
+21
View File
@@ -0,0 +1,21 @@
//! # BAT Patch
//!
//! Patch 引擎核心实现
//!
//! 支持:
//! - Binary Diff/Patch
//! - JSON Patch
//! - Rollback
//! - Integrity Check
#![warn(missing_docs)]
#![warn(clippy::all)]
pub mod error;
pub mod binary;
pub mod json;
pub use error::{PatchError, Result};
/// Patch 引擎版本号
pub const VERSION: &str = env!("CARGO_PKG_VERSION");