uniffi-rs
uniffi-rs copied to clipboard
Allow foreign implementations of PartialEq, Eq, Hash etc traits
From reading the manual and searching a bit, I don't think it's currently possible for my uniffi::Object and uniffi::Record types to expose their PartialEq, Eq, Hash, etc implementations?
Right now, I used a cheap workaround in my PR:
#[uniffi::export]
impl SigningIdentity {
/// Is `self` equal to `other`?
fn equals(&self, other: &Self) -> bool {
self == other
}
}
Ideally, the PartialEq impl would make it through. In Python, the __eq__ method could be wired up to delegate to PartialEq::eq, etc. The consequence of not having this is that things like assertions become more cumbersome.
Have I missed something in the manual about this?