nitinol_core/
errors.rs

1use std::error::Error;
2
3#[derive(Debug, thiserror::Error)]
4#[error("Failed to serialize event: {0}")]
5pub struct SerializeError(Box<dyn Error + Sync + Send>);
6
7impl<E: serde::ser::Error + Sync + Send + 'static> From<E> for SerializeError {
8    fn from(value: E) -> Self {
9        Self(Box::new(value))
10    }
11}
12
13#[derive(Debug, thiserror::Error)]
14#[error("Failed to deserialize event: {0}")]
15pub struct DeserializeError(Box<dyn Error + Sync + Send>);
16
17impl<E: serde::de::Error + Sync + Send + 'static> From<E> for DeserializeError {
18    fn from(value: E) -> Self {
19        Self(Box::new(value))
20    }
21}