use thiserror::Error;
pub type FastPForResult<T> = Result<T, FastPForError>;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum FastPForError {
#[error("Unsupported operation")]
Unimplemented,
#[error("Not enough data in the input buffer")]
NotEnoughData,
#[error("Output buffer too small")]
OutputBufferTooSmall,
#[error("Invalid input length {0}")]
InvalidInputLength(usize),
#[error("Page size {page_size} is not a multiple of block size {block_size}")]
InvalidPageSize {
page_size: u32,
block_size: u32,
},
#[cfg(feature = "cpp")]
#[error("C++ exception: {0}")]
CppError(#[from] cxx::Exception),
#[error("Expected element count {expected} exceeds maximum {max}")]
ExpectedCountExceedsMax {
expected: usize,
max: usize,
},
#[error("Decoded {actual} elements, expected {expected}")]
DecodedCountMismatch {
actual: usize,
expected: usize,
},
}