Diffstat (limited to 'src/any.rs')
-rw-r--r--src/any.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/any.rs b/src/any.rs
index 94a4b49..028f610 100644
--- a/src/any.rs
+++ b/src/any.rs
@@ -155,6 +155,11 @@ where
// }
// ```
pub trait AnyTrait<'ctx> {
+ /// The trait objects this type can be upcasted to.
+ type Available
+ where
+ Self: Sized;
+
/// Upcast a borrow to the given trait object.
///
/// Use the `<dyn AnyTrait>::upcast()` helper method instead, if possible.
@@ -252,6 +257,10 @@ macro_rules! any_trait {
impl<$lt $($generic)*> $crate::any::AnyTrait<$lt> for $name
$(where $($bound)*)?
{
+ type Available = (
+ $($protocol,)*
+ );
+
#[inline(always)]
fn upcast_to_id<'__>(
&'__ self,