use alloc::string::{String, ToString};
use core::fmt;
#[derive(Debug, Clone, PartialEq)]
pub enum Error {
Rkyv(String),
Json(String),
Unsupported(String),
Other(String),
#[cfg(feature = "reader")]
WasmRuntime(String),
#[cfg(feature = "reader")]
WasmMemory(String),
#[cfg(feature = "reader")]
WasmExport(String),
#[cfg(feature = "reader")]
FfiError(String),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Data-Driver Error: {:?}", &self)
}
}
impl From<serde_json::Error> for Error {
fn from(value: serde_json::Error) -> Self {
Self::Json(value.to_string())
}
}