pub trait AsAny: Any {
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}Expand description
A trait to work around not having trait object upcasting:
Add AsAny as supertrait and your trait objects can be turned into &dyn Any on which you can
then call downcast.