fusio_core/dynamic/
error.rs

1use alloc::boxed::Box;
2
3pub type BoxedError = Box<dyn core::error::Error + Send + Sync + 'static>;
4
5pub struct Error {
6    inner: BoxedError,
7}
8
9impl core::fmt::Debug for Error {
10    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11        core::fmt::Debug::fmt(&self.inner, f)
12    }
13}
14
15impl core::fmt::Display for Error {
16    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17        core::fmt::Display::fmt(&self.inner, f)
18    }
19}
20
21impl core::error::Error for Error {}
22
23impl From<BoxedError> for Error {
24    fn from(inner: BoxedError) -> Self {
25        Self { inner }
26    }
27}