Starting a type casting trait
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user