pub use tokio; pub use tracing; #[derive(Debug)] pub enum PluginError { FunctionError(String), Other(String), } impl core::fmt::Display for PluginError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { PluginError::FunctionError(msg) => write!(f, "Function error: {}", msg), PluginError::Other(msg) => write!(f, "Other error: {}", msg), } } } impl std::error::Error for PluginError {} //pub type AsyncFnReturnType = Result<(), PluginError>; //pub type AsyncFn = Box< // dyn Fn() // -> std::pin::Pin + Send + Sync>> // + Send // + Sync, //>; pub type AsyncFnReturnType = tokio::task::JoinHandle>; pub type AsyncFn = Box AsyncFnReturnType + Send + Sync>;