pub enum SynaError {
Show 21 variants
Io(Error),
Serialization(Error),
NotFound(String),
InvalidPath(String),
KeyNotFound(String),
CorruptedEntry(u64),
DecompressionFailed,
EmptyKey,
KeyTooLong(usize),
InvalidDimensions(u16),
DimensionMismatch {
expected: u16,
got: u16,
},
CorruptedIndex(String),
ShapeMismatch {
data_size: usize,
expected_size: usize,
},
TypeConversion {
from_type: &'static str,
to_type: &'static str,
},
ModelNotFound(String),
ChecksumMismatch {
expected: String,
got: String,
},
RunNotFound(String),
RunAlreadyEnded(String),
GpuUnavailable(String),
GpuOutOfMemory(String),
IndexError(String),
}Expand description
Comprehensive error types for Syna database operations.
§Examples
use synadb::{SynaDB, SynaError, Result};
fn example() -> Result<()> {
let mut db = SynaDB::new("test.db")?;
// Empty keys are rejected
match db.append("", 42i64.into()) {
Err(SynaError::EmptyKey) => println!("Empty key rejected"),
_ => {}
}
Ok(())
}Variants§
Io(Error)
I/O error during file operations.
Serialization(Error)
Serialization or deserialization error.
NotFound(String)
Database not found in the global registry.
InvalidPath(String)
Invalid file path.
KeyNotFound(String)
Key not found in the database.
CorruptedEntry(u64)
Corrupted entry detected at the given file offset.
DecompressionFailed
LZ4 decompression failed.
EmptyKey
Empty key is not allowed.
KeyTooLong(usize)
Key exceeds maximum length (65535 bytes).
InvalidDimensions(u16)
Invalid vector dimensions (must be 64-4096).
DimensionMismatch
Vector dimension mismatch.
CorruptedIndex(String)
Corrupted HNSW index file.
ShapeMismatch
Shape mismatch in tensor operations.
TypeConversion
Type conversion error in tensor operations.
ModelNotFound(String)
Model not found in the registry.
ChecksumMismatch
Checksum mismatch when loading a model.
Fields
RunNotFound(String)
Experiment run not found.
RunAlreadyEnded(String)
Experiment run has already ended.
GPU is unavailable or not supported.
GpuOutOfMemory(String)
GPU out of memory.
IndexError(String)
Index operation error (e.g., FAISS index creation/search failed).