facet_yaml/serialize/
error.rs1pub enum YamlSerError {
5 InvalidNumberToI64Conversion {
7 source_type: &'static str,
9 },
10 InvalidKeyConversion {
12 yaml_type: &'static str,
14 },
15 UnsupportedByteArray,
17}
18
19impl core::fmt::Display for YamlSerError {
20 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
21 match self {
22 Self::InvalidNumberToI64Conversion { source_type } => {
23 write!(f, "Error converting {source_type} to i64, out of range")
24 }
25 Self::InvalidKeyConversion { yaml_type } => {
26 write!(f, "Error converting type {yaml_type} to YAML key")
27 }
28 Self::UnsupportedByteArray => {
29 write!(f, "YAML doesn't support byte arrays")
30 }
31 }
32 }
33}
34
35impl core::error::Error for YamlSerError {}
36
37impl core::fmt::Debug for YamlSerError {
38 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
39 core::fmt::Display::fmt(self, f)
40 }
41}