#[cfg(feature = "error-stack")]
pub(crate) trait ErasedError: std::fmt::Debug + std::fmt::Display + Send + Sync {}
#[cfg(feature = "error-stack")]
impl<T> ErasedError for T where T: std::fmt::Debug + std::fmt::Display + Send + Sync {}
#[cfg(feature = "error-stack")]
pub struct BoxError(pub(crate) Box<dyn ErasedError>);
#[cfg(feature = "error-stack")]
impl std::fmt::Display for BoxError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
#[cfg(feature = "error-stack")]
impl std::fmt::Debug for BoxError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
#[cfg(feature = "error-stack")]
impl std::error::Error for BoxError {}
#[cfg(feature = "error-stack")]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DbuffErr;
#[cfg(feature = "error-stack")]
impl std::fmt::Display for DbuffErr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "command execution failed")
}
}
#[cfg(feature = "error-stack")]
impl std::error::Error for DbuffErr {}