36 lines
908 B
Rust
36 lines
908 B
Rust
//! Error types for the RadixTree module.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Error type for RadixTree operations.
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
/// Error from OurDB operations.
|
|
#[error("OurDB error: {0}")]
|
|
OurDB(#[from] ourdb::Error),
|
|
|
|
/// Error when a key is not found.
|
|
#[error("Key not found: {0}")]
|
|
KeyNotFound(String),
|
|
|
|
/// Error when a prefix is not found.
|
|
#[error("Prefix not found: {0}")]
|
|
PrefixNotFound(String),
|
|
|
|
/// Error during serialization.
|
|
#[error("Serialization error: {0}")]
|
|
Serialization(String),
|
|
|
|
/// Error during deserialization.
|
|
#[error("Deserialization error: {0}")]
|
|
Deserialization(String),
|
|
|
|
/// Error for invalid operations.
|
|
#[error("Invalid operation: {0}")]
|
|
InvalidOperation(String),
|
|
|
|
/// Error for I/O operations.
|
|
#[error("I/O error: {0}")]
|
|
IO(#[from] std::io::Error),
|
|
}
|