Skip to content

Allow direct object comparison in bindings if types impl Eq #322

@Alex6323

Description

@Alex6323

Many types can be compared for equality, which currently is not exposed to the bindings but can easily be done through:
#[uniffi::export(Eq)]. As an example in a Python binding example it was necessary to compare the StructTag of a type.
This was only possible so far by comparing the string (Display) representation, but that is not ideal.

Updated struct:

#[derive(derive_more::From, derive_more::Display, uniffi::Object, PartialEq)]
#[uniffi::export(Display, Eq)]
pub struct StructTag(pub iota_types::StructTag);

let's you then use == comparision directly on the types in the bindings language.

BLOCKED BY #433

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions