awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)
Apache License 2.0
70 stars 13 forks source link

[uniffi] Introduce a `GroupId` newtype wrapper #147

Open mgeisler opened 2 months ago

mgeisler commented 2 months ago

Issues:

Addresses #81.

Description of changes:

This case up during our API review: instead of exposing a Vec<u8>, we can let the API use a GroupId newtype wrapper.

Call-outs:

A downside of this is that UniFFI doesn’t support exposing traits like Hash on its record types (see https://github.com/mozilla/uniffi-rs/issues/2043). A consequence of this is that the Python GroupId type is not hashable. I therefore ended up accessing the .id attribute directly in the integration test.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.