BREAKING CHANGE(core): replace the TypeScript database engine with a Rust-backed embedded server and bridge

This commit is contained in:
2026-03-26 19:48:27 +00:00
parent 8ec2046908
commit e23a951dbe
106 changed files with 11567 additions and 10678 deletions
+40
View File
@@ -0,0 +1,40 @@
use thiserror::Error;
/// Errors that can occur in storage operations.
#[derive(Debug, Error)]
pub enum StorageError {
#[error("not found: {0}")]
NotFound(String),
#[error("already exists: {0}")]
AlreadyExists(String),
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
#[error("serialization error: {0}")]
SerializationError(String),
#[error("conflict detected: {0}")]
ConflictError(String),
}
impl From<serde_json::Error> for StorageError {
fn from(e: serde_json::Error) -> Self {
StorageError::SerializationError(e.to_string())
}
}
impl From<bson::de::Error> for StorageError {
fn from(e: bson::de::Error) -> Self {
StorageError::SerializationError(e.to_string())
}
}
impl From<bson::ser::Error> for StorageError {
fn from(e: bson::ser::Error) -> Self {
StorageError::SerializationError(e.to_string())
}
}
pub type StorageResult<T> = Result<T, StorageError>;