use super::{
super::super::{common::*, problem::*},
problem::*,
};
use std::error::*;
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
pub trait IntoSerdeProblem {
fn into_serde_serialize_problem(self) -> SerdeProblem;
fn into_serde_deserialize_problem(self) -> SerdeProblem;
}
impl<ErrorT> IntoSerdeProblem for ErrorT
where
ErrorT: 'static + Error + Send + Sync,
{
#[track_caller]
fn into_serde_serialize_problem(self) -> SerdeProblem {
self.into_problem()
.via(SerializationError::new("serde"))
.into()
}
#[track_caller]
fn into_serde_deserialize_problem(self) -> SerdeProblem {
self.into_problem()
.via(DeserializationError::new("serde"))
.into()
}
}