valkyrie_errors/runtime/for_serde.rs
1use std::fmt::Display;
2
3use crate::ValkyrieError;
4
5impl serde::ser::Error for ValkyrieError {
6 fn custom<T>(msg: T) -> Self
7 where
8 T: Display,
9 {
10 ValkyrieError::runtime_error(msg.to_string())
11 }
12}
13
14impl serde::de::Error for ValkyrieError {
15 fn custom<T>(msg: T) -> Self
16 where
17 T: Display,
18 {
19 ValkyrieError::runtime_error(msg.to_string())
20 }
21}