This is the first crate I published so I am new to making things production ready. Therefore use this crate with caution and feedback is welcome.
To implement PartialEq on types with trait object fields you can use the derive macro PartialEqDyn. The implementation needs the traits that are present as trait objects to have AsAny and DynPartialEq as supertraits. For those traits there also exist derive macros AsAny and DynPartialEq. Here an Example: ``` use partialeqdyn::{AsAny, DynPartialEq}; use partialeqdyn_derive::{AsAny, DynPartialEq, PartialEqDyn};
trait TestTrait: core::fmt::Debug + AsAny + DynPartialEq {}
struct TestTraitImplementor(i32);
impl TestTrait for TestTraitImplementor {}
struct TestStruct {
field1: i32,
field2: Box
Or if the type implements the trait itself:
``` use partialeqdyn::{AsAny, DynPartialEq}; use partialeqdyn_derive::{AsAny, DynPartialEq, PartialEqDyn};
trait TestTrait: core::fmt::Debug + AsAny + DynPartialEq {}
struct TestStruct {
field1: i32,
field2: Box
impl TestTrait for TestStruct {} ```