Commenting out the parameterscontext type.
This commit is contained in:
@@ -4,7 +4,10 @@ use crate::renderer::errors::WalkError;
|
||||
use std::any::Any;
|
||||
use std::fmt::Debug;
|
||||
|
||||
pub trait ContextElement: Debug + Walkable + Renderable + Loopable {}
|
||||
pub trait ContextElement:
|
||||
Debug + Walkable + Renderable + Loopable + IntoBoxedContextElement
|
||||
{
|
||||
}
|
||||
|
||||
pub trait Walkable {
|
||||
fn walk(&self, segment: &str) -> Result<&dyn ContextElement, WalkError>;
|
||||
@@ -31,6 +34,16 @@ pub trait CompareContextElement {
|
||||
fn to_any(&self) -> &dyn Any;
|
||||
}
|
||||
|
||||
pub trait IntoBoxedContextElement {
|
||||
fn to_box(self) -> Box<dyn ContextElement>;
|
||||
}
|
||||
|
||||
impl<C: 'static + ContextElement> IntoBoxedContextElement for C {
|
||||
fn to_box(self) -> Box<dyn ContextElement> {
|
||||
Box::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
// impl PartialEq<dyn ContextElement> for dyn ContextElement {
|
||||
// fn eq(&self, other: &dyn ContextElement) -> bool {
|
||||
// todo!()
|
||||
|
||||
Reference in New Issue
Block a user