1use crate::base::VInt64;
2
3#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error("I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("Invalid variable-length integer encoding, 8 leading zeros found...")]
12 InvalidVInt,
13
14 #[error("Attempted to read past the end of the buffer")]
16 OutOfBounds,
17
18 #[error("Element body over decode, ID: {0}")]
20 OverDecode(VInt64),
21
22 #[error("Short read: not all bytes were consumed")]
24 ShortRead,
25
26 #[error("Element body under decode, ID: {0}")]
28 UnderDecode(VInt64),
29}
30
31pub type Result<T> = std::result::Result<T, Error>;