diff --git a/src/nodes/item.rs b/src/nodes/item.rs index 6cb61b0..fc82e7c 100644 --- a/src/nodes/item.rs +++ b/src/nodes/item.rs @@ -72,7 +72,15 @@ pub struct TypeInfo { acceptors: Registry, } -pub trait Item { +pub trait AsItemTrait { + fn as_trait(&self) -> &dyn Item; +} +impl AsItemTrait for T { + fn as_trait(&self) -> &dyn Item { + self + } +} +pub trait Item: AsItemTrait { fn get_type_info(&self) -> &'static TypeInfo; fn get_data(&self) -> &ItemData; fn get_node(&self) -> Arc {