#![deny(missing_docs)]
#![allow(clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![feature(associated_type_defaults)]
#![feature(unboxed_closures)]
#![feature(fn_traits)]
#![feature(impl_trait_in_assoc_type)]
#![feature(get_mut_unchecked)]
pub use logimesh_macro::{component, derive_serde};
pub mod client;
pub mod component;
pub mod context;
pub mod net;
pub mod server;
pub mod transport;
pub use ::tarpc::{serde, tokio_serde, tokio_util, ChannelError, ClientMessage, Request, RequestName, Response, ServerError};
pub use transport::Transport;
pub mod trace;
pub use {::futures, ::tracing};
#[allow(unreachable_pub, dead_code)]
mod sealed {
pub trait Sealed<T> {}
}
pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
pub trait IntoAnyResult<T> {
fn any_result(self) -> Result<T, anyhow::Error>;
}
impl<T> IntoAnyResult<T> for Result<T, BoxError> {
fn any_result(self) -> Result<T, anyhow::Error> {
self.map_err(|e| anyhow::anyhow!("{e:?}"))
}
}
#[test]
fn any_result() {
let r: Result<bool, BoxError> = Err(BoxError::from("NaN".parse::<u32>().unwrap_err()));
println!("{:?}", r.any_result());
}