1#[derive(thiserror::Error, Debug, PartialEq, Eq, Clone, Copy)]
5#[non_exhaustive]
6pub enum Error {
7 #[error(transparent)]
9 Truncated(#[from] Truncated),
10
11 #[error(transparent)]
13 ExtraneousBytes(#[from] ExtraneousBytes),
14
15 #[error("deserialisation error: {0}")]
18 Deserialization(&'static str),
19}
20
21#[derive(thiserror::Error, Debug, PartialEq, Eq, Clone, Copy)]
23#[error("object truncated (or not fully present)")]
24pub struct Truncated;
25
26#[rustfmt::skip]
27#[derive(thiserror::Error, Debug, PartialEq, Eq, Clone, Copy)]
29#[error("extra bytes at end of object")]
30pub struct ExtraneousBytes;