From 080cc42bb1da09059dbc35049a7ded0649961e0c Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 29 Aug 2022 20:52:56 +0200 Subject: feat: implement async functionality --- src/libs/intertrait/mod.rs | 7 +++++-- src/libs/mod.rs | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/libs') diff --git a/src/libs/intertrait/mod.rs b/src/libs/intertrait/mod.rs index 2d62871..bdae4c7 100644 --- a/src/libs/intertrait/mod.rs +++ b/src/libs/intertrait/mod.rs @@ -23,7 +23,7 @@ //! MIT license (LICENSE-MIT or ) //! //! at your option. -use std::any::{Any, TypeId}; +use std::any::{type_name, Any, TypeId}; use std::rc::Rc; use std::sync::Arc; @@ -60,7 +60,10 @@ static CASTER_MAP: Lazy> = Lazy::new(|| fn cast_arc_panic(_: Arc) -> Arc { - panic!("Prepend [sync] to the list of target traits for Sync + Send types") + panic!( + "Interface trait '{}' has not been marked async", + type_name::() + ) } /// A `Caster` knows how to cast a reference to or `Box` of a trait object for `Any` diff --git a/src/libs/mod.rs b/src/libs/mod.rs index 8d5583d..b1c7a74 100644 --- a/src/libs/mod.rs +++ b/src/libs/mod.rs @@ -1,3 +1,5 @@ pub mod intertrait; +#[cfg(feature = "async")] +pub extern crate async_trait; pub extern crate linkme; -- cgit v1.2.3-18-g5258