base_message/
field_value_error.rs1use std::fmt;
5
6#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
8pub struct FieldValueError {
9 reason: &'static str,
10}
11
12impl FieldValueError {
13 pub const fn new(reason: &'static str) -> Self {
15 Self { reason }
16 }
17
18 pub const fn reason(&self) -> &'static str {
20 self.reason
21 }
22}
23
24impl fmt::Display for FieldValueError {
25 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
26 formatter.write_str(self.reason)
27 }
28}
29
30impl std::error::Error for FieldValueError {}