Trait springtime_di::component::ComponentDowncast
source · pub trait ComponentDowncast<C: Component>: Injectable {
// Required method
fn downcast(
source: ComponentInstanceAnyPtr
) -> Result<ComponentInstancePtr<Self>, ComponentInstanceAnyPtr>;
}Expand description
Helper trait for traits implemented by components, thus allowing injection of components based
on dyn Trait types. The type C refers to a concrete component type. Typically automatically
derived when using the #[component_alias] attribute.