Debugging callback structs

I'm trying to test a struct that calls back to a listener whenever its internal state changes using an interface like this:

pub struct StateDetails {
    id: String,
    name: String,
    info: Vec<u16>,
    // ...
}

#[cfg_attr(test, mockall::automock)]
pub trait StateChangeListener: Send + Sync {
    fn on_state_change(&self, state: &StateDetails);
}

I'm using mockall to produce tests of my class. The problem I'm running into is that if I just

let mock_listener = MockStateChangeListener::new();
let expected_state = StateDetails { ... };
mock_listener
    .expect_on_state_change()
    .times(1)
    .with(eq(expected_state))
    .returning(|_| ());

Then when if the supplied struct is different I get no information about what was different. To fix this I wrote my own comparison method and writes debug printouts, but that's obviously not ideal. Is there a better way to do this so that I get useful debug outputs? Like an equality predicate that can output useful struct diffs?

I've not used mockall, but with a regular assert_eq!(), a failed test will print a message like this:

assertion `left == right` failed
  left: [...]
 right: [...]

would you please provide an example how mockall reports failed equality comparison? and what's your expected behavior?

Here's an example of what mockall outputs:

thread 'listener_test' (30296616) panicked at tests/common/mod.rs:34:1:
MockStateChangeListener::on_state_change(StateDetails { id: "...", name: "test-3of5", info: [...] }): No matching expectation found

It doesn't give what was expected, and it's really hard to parse where the failure came from. It would be really helpful if there were a struct equality predicate that could have debug info turned on when needed for what's wrong/different.

can't you just wrap an assert_eq!() as your predicate? is the panic message good enough for you? the rust test harness treats any panic inside a test case as a failure (unless #[should_panic] is used, of course), I feel like the mock predicate is almost redendent.

I see there's a function() predicate, you can just create a wrapper, something like this:

fn my_eq(expected: StateDetails) -> impl Predicate<StateDetails> {
    function(move |actual: &StateDetails| {
        assert_eq!(expected, actual);
        true
    })
}

Unfortunately, in my particular test I'm expecting several calls to the callback, each with different params. I was hoping the sequencing in mockall would do the trick, but sadly it doesn't. So what I'm looking for is a comparison that tells me what's different so I can trace it back and figure out why the test failed.