[][src]Macro downcast_trait::downcast_trait

macro_rules! downcast_trait {
    ( dyn $type:path, $src:expr) => { ... };
}

This macro can be used to cast a &dyn DowncastTrait to an implemented trait e.g:

This example is not tested
if let Some(sub_container) =
    downcast_trait!(dyn Container, sub_widget.as_ref().to_downcast_trait())
{
  //Use downcasted trait
}