Rust-centric architecture with TypeScript facade following smartproxy/smartstorage pattern. Core engine in Rust (FastCDC chunking, SHA-256, gzip, AES-256-GCM + Argon2id, binary pack files, global index, snapshots, locking, verification, pruning, repair). TypeScript provides npm interface via @push.rocks/smartrust RustBridge IPC with Unix socket streaming for ingest/restore. All 14 integration tests pass.
38 lines
719 B
Rust
38 lines
719 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum ArchiveError {
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("Configuration error: {0}")]
|
|
Config(String),
|
|
|
|
#[error("Data corruption: {0}")]
|
|
Corruption(String),
|
|
|
|
#[error("Encryption error: {0}")]
|
|
Encryption(String),
|
|
|
|
#[error("Not found: {0}")]
|
|
NotFound(String),
|
|
|
|
#[error("Repository is locked: {0}")]
|
|
Locked(String),
|
|
|
|
#[error("Invalid repository: {0}")]
|
|
InvalidRepo(String),
|
|
|
|
#[error("JSON error: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
|
|
#[error("{0}")]
|
|
Other(String),
|
|
}
|
|
|
|
impl ArchiveError {
|
|
pub fn to_error_string(&self) -> String {
|
|
format!("{}", self)
|
|
}
|
|
}
|