Protocols and pattern matching?

If one of your implementations has to deal with arbitrary structs then defimpl can’t help you I think. If it’s one particular type of struct then it should be fine.

I tried to demystify protocols a bit and explain the difference between those and behaviours in my post here.

Could you post here the details of the other struct you’re trying to match on? I think you can use protocols for this.