2023-02-09 18:19:03 +00:00
|
|
|
pub use std::future::Future;
|
|
|
|
|
2023-01-19 17:18:41 +00:00
|
|
|
pub use tokio::pin;
|
|
|
|
pub use tokio::select;
|
2023-02-14 00:44:03 +00:00
|
|
|
pub use tokio::sync::oneshot::{channel as oneshot, Receiver as Deferred, Sender as Promise};
|
2023-02-14 17:53:43 +00:00
|
|
|
pub use tokio::task::JoinHandle;
|
2023-01-19 17:18:41 +00:00
|
|
|
|
|
|
|
pub mod log {
|
|
|
|
pub use tracing::{debug, error, info, warn};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, anyhow::Error>;
|
2023-04-13 22:38:26 +00:00
|
|
|
pub type Str = std::sync::Arc<str>;
|
2023-02-14 19:42:52 +00:00
|
|
|
|
2023-03-05 21:04:28 +00:00
|
|
|
pub fn fail(msg: &str) -> anyhow::Error {
|
|
|
|
anyhow::Error::msg(msg.to_owned())
|
2023-02-14 19:42:52 +00:00
|
|
|
}
|
2023-03-06 11:49:51 +00:00
|
|
|
|
|
|
|
macro_rules! ffail {
|
|
|
|
($($arg:tt)*) => {
|
|
|
|
fail(&format!($($arg)*))
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) use ffail;
|