datex_core/values/traits/
structural_eq.rs

1pub trait StructuralEq {
2    /// Check if two values are equal, ignoring the type.
3    fn structural_eq(&self, other: &Self) -> bool;
4}
5
6#[macro_export]
7macro_rules! assert_structural_eq {
8    ($left_val:expr, $right_val:expr $(,)?) => {
9        if !$left_val.structural_eq(&$right_val) {
10            panic!(
11                "structural equality assertion failed: `(left == right)`\n  left: `{:?}`,\n right: `{:?}`",
12                $left_val, $right_val
13            );
14        }
15    };
16}