Starting a type casting trait

This commit is contained in:
Tom Alexander
2020-06-13 19:39:31 -04:00
parent 11096d7ece
commit 9eb70f436c
5 changed files with 27 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ pub trait ContextElement:
+ CompareContextElement
+ FromContextElement
+ IntoRcIce
+ Castable
{
}
@@ -54,6 +55,10 @@ pub trait Loopable {
fn get_loop_elements(&self) -> Vec<&dyn ContextElement>;
}
pub trait Castable {
fn cast_to_type<'a>(&'a self, target: &str) -> Option<IceResult<'a>>;
}
pub trait CastToAny {
fn to_any(&self) -> &dyn Any;
}