Skip to main content

refix_message/value/
error.rs

1use crate::Tag;
2
3/// A field value whose bytes can't be read as the field's declared data type.
4#[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 {}