medea_jason/utils/
errors.rs1use std::rc::Rc;
4
5use derive_more::with_trait::{Display, From};
6pub use medea_macro::Caused;
7
8pub trait Caused {
10 type Error;
12
13 fn cause(self) -> Option<Self::Error>;
15}
16
17#[derive(Clone, Debug, Display, From)]
23#[from(forward)]
24pub struct JsonParseError(Rc<serde_json::Error>);
25
26impl PartialEq for JsonParseError {
27 fn eq(&self, other: &Self) -> bool {
28 self.0.line() == other.0.line()
29 && self.0.column() == other.0.column()
30 && self.0.classify() == other.0.classify()
31 }
32}