pub trait DynPartialEqDraw: DynCloneDraw {
// Required methods
fn as_any(&self) -> &dyn Any;
fn dyn_eq(&self, other: &dyn DynPartialEqDraw) -> bool;
}
Expand description
A trait that allows for dynamic equality testing of trait objects.
This trait provides a workaround for the fact that PartialEq
is not object-safe.
It allows types that are PartialEq
to be compared even when they are behind
a trait object by downcasting them to their concrete types.
Required Methods§
Sourcefn dyn_eq(&self, other: &dyn DynPartialEqDraw) -> bool
fn dyn_eq(&self, other: &dyn DynPartialEqDraw) -> bool
Performs a dynamic equality check against another DynPartialEqDraw
trait object.