1pub mod config;
2pub mod error;
3pub mod support;
4pub mod traits;
5
6cfg_if::cfg_if! {
7 if #[cfg(feature = "eyre")]{
8 pub type AnyError = eyre::Report;
9 }else if #[cfg(feature = "anyhow")]{
10 pub type AnyError = anyhow::Error;
11 }else{
12 pub type AnyError = BoxError;
13 }
14}
15
16pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
17
18pub type BoxFuture<'a, T = ()> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + 'a>>;
19
20pub type BoxClosure<T = ()> = Box<dyn Fn() -> T + Send + Sync>;
21
22pub type BoxCallback<P = (), R = ()> = Box<dyn Fn(P) -> R + Send + Sync>;
23
24pub type Closure<T = ()> = std::sync::Arc<dyn Fn() -> T + Send + Sync>;
25
26pub type Callback<P = (), R = ()> = std::sync::Arc<dyn Fn(P) -> R + Send + Sync>;
27
28pub type Instance = std::sync::Arc<dyn std::any::Any + Send + Sync>;
29
30pub type Result<T, E = AnyError> = std::result::Result<T, E>;
31
32pub type SharedString = std::borrow::Cow<'static, str>;
33
34pub use async_trait::async_trait;
36pub use cfg_if::cfg_if;