pub trait DynEq: EqSealed {
// Required method
fn dyn_eq(&self, other: &dyn Any) -> bool;
}Expand description
A dyn-compatible version of Eq trait.
The implementation constraints for this trait are the same as for Eq:
the implementation must be reflexive, symmetric, and transitive.
Additionally, if two values can be compared with DynEq and PartialEq then
they must be DynEq-equal if and only if they are PartialEq-equal.
It is therefore strongly discouraged to implement this trait for types
that implement PartialEq<Other> or Eq<Other> for any type Other other than Self.
Note: This trait should not be implemented directly. Implement Eq and Any and use
the blanket implementation.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".