|
|
|
@ -12,7 +12,7 @@ pub trait ContextElement:
|
|
|
|
|
+ Walkable
|
|
|
|
|
+ Renderable
|
|
|
|
|
+ Loopable
|
|
|
|
|
+ CloneIntoBoxedContextElement
|
|
|
|
|
// + CloneIntoBoxedContextElement
|
|
|
|
|
+ CompareContextElement
|
|
|
|
|
+ FromContextElement
|
|
|
|
|
{
|
|
|
|
@ -62,15 +62,15 @@ pub trait CompareContextElement: CastToAny {
|
|
|
|
|
fn partial_compare(&self, other: &dyn ContextElement) -> Option<Ordering>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub trait CloneIntoBoxedContextElement {
|
|
|
|
|
fn clone_to_box(&self) -> Box<dyn IntoContextElement>;
|
|
|
|
|
}
|
|
|
|
|
// pub trait CloneIntoBoxedContextElement {
|
|
|
|
|
// fn clone_to_box(&self) -> Box<dyn IntoContextElement>;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
impl<C: 'static + IntoContextElement + Clone> CloneIntoBoxedContextElement for C {
|
|
|
|
|
fn clone_to_box(&self) -> Box<dyn IntoContextElement> {
|
|
|
|
|
Box::new(self.clone())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// impl<C: 'static + IntoContextElement + Clone> CloneIntoBoxedContextElement for C {
|
|
|
|
|
// fn clone_to_box(&self) -> Box<dyn IntoContextElement> {
|
|
|
|
|
// Box::new(self.clone())
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
impl<C: 'static + ContextElement> CastToAny for C {
|
|
|
|
|
fn to_any(&self) -> &dyn Any {
|
|
|
|
@ -100,7 +100,7 @@ impl<C: ContextElement> FromContextElement for C {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub trait IntoContextElement: Debug + Walkable + CloneIntoBoxedContextElement {
|
|
|
|
|
pub trait IntoContextElement: Debug + Walkable /* + CloneIntoBoxedContextElement*/ {
|
|
|
|
|
fn into_context_element(
|
|
|
|
|
&self,
|
|
|
|
|
renderer: &DustRenderer,
|
|
|
|
|