use thiserror::Error;
#[derive(Debug, Error)]
pub enum IndexError {
#[error("Index I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Segment not found in catalog: {0}")]
SegmentNotFound(u64),
#[error("Corrupt index: {detail}")]
Corrupt {
detail: String,
},
#[error("Binary serialization error: {0}")]
BinarySerialization(String),
#[error("Manifest error: {detail}")]
Manifest {
detail: String,
},
}
pub type Result<T> = std::result::Result<T, IndexError>;