refix_message/value/
error.rs1use crate::Tag;
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub struct InvalidValue {
6 pub tag: Tag,
7}
8
9impl std::fmt::Display for InvalidValue {
10 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11 write!(f, "invalid value in field {}", self.tag)
12 }
13}
14
15impl std::error::Error for InvalidValue {}
16
17#[derive(Clone, Copy, Debug, Eq, PartialEq)]
19pub struct OutOfRange;
20
21impl std::fmt::Display for OutOfRange {
22 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 f.write_str("value out of range")
24 }
25}
26
27impl std::error::Error for OutOfRange {}