Diffstat (limited to 'src/any.rs')
| -rw-r--r-- | src/any.rs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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, |