use send_wrapper::SendWrapper;
use std::fmt;
use wasm_split_helpers::SplitLoaderError;
#[derive(Clone)]
pub struct LazyViewError(SendWrapper<SplitLoaderError>);
impl fmt::Debug for LazyViewError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&*self.0, f)
}
}
impl fmt::Display for LazyViewError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&*self.0, f)
}
}
impl std::error::Error for LazyViewError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Some(&*self.0)
}
}
impl From<SplitLoaderError> for LazyViewError {
fn from(err: SplitLoaderError) -> Self {
Self(SendWrapper::new(err))
}
}