1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use tea_codec_macros::define_scope;
use thiserror::Error;
define_scope! {
Serde {
TypeIdMismatch => TypeIdMismatch, @Display, @Debug;
InvalidFormat => InvalidFormat, @Display, @Debug;
}
}
#[derive(Debug, Error)]
#[error("Type id does not match, expected \"{0}\", actual \"{1}\"")]
pub struct TypeIdMismatch(pub &'static str, pub String);
#[derive(Debug, Error)]
#[error("Type id \"{0}\" is not supported here")]
pub struct UnexpectedType(pub String);
#[derive(Debug, Error)]
#[error("Invalid byte format when reading {0}")]
pub struct InvalidFormat(pub &'static str);