Adding trait to cast to Any.

This commit is contained in:
Tom Alexander 2020-05-10 17:12:15 -04:00
parent c438653449
commit f386e5c31b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -1,6 +1,7 @@
use crate::parser::Filter;
use crate::renderer::errors::RenderError;
use crate::renderer::errors::WalkError;
use std::any::Any;
use std::fmt::Debug;
pub trait ContextElement: Debug + Walkable + Renderable + Loopable {}
@ -26,6 +27,10 @@ pub trait Loopable {
fn get_loop_elements(&self) -> Vec<&dyn ContextElement>;
}
pub trait CompareContextElement {
fn to_any(&self) -> &dyn Any;
}
// impl PartialEq<dyn ContextElement> for dyn ContextElement {
// fn eq(&self, other: &dyn ContextElement) -> bool {
// todo!()