UniFFI the `GetItemsOptions` builder in Remote Settings
linabutler opened this issue · 1 comments
linabutler commented
#5591 added a GetItemsOptions
builder, and a Rust-only Client::get_records_raw_with_options
interface, to the Remote Settings component. https://github.com/mozilla/application-services/pull/5591/files#r1200749247 pointed out that this could be useful to expose to applications—that is, UniFFI consumers—too, not just other Rust consumers.
This ticket would involve:
- Adding a UDL definition for
GetItemsOptions
, or a wrapper around it with a different name. - Implementing the new UDL definition in Rust. The way we do this depends on what we expose. If we opt to expose
GetItemsOptions
directly, we'll need to make it thread-safe, because UniFFI requires all interfaces to beSend + Sync
. This would involve protecting its mutable state with a mutex. If we instead expose a UniFFI-compatible wrapper aroundGetItemsOptions
, thenGetItemsOptions
can remain mutable, and the wrapper can just hold aMutex<GetItemsOptions>
. - Adding new methods to
remote_settings::Client
andremote_settings::RemoteSettings
that return aRemoteSettingsResponse
. This new method would callget_records_raw_with_options
, just like the existingRemoteSettings::get_records
eventually callsClient::get_records_raw
. - Adding Rust and Kotlin tests for the new interfaces.
This is a good next bug for folks interested in getting more familiar with UniFFI, and how we ship Rust code in Application Services. I'd be happy to mentor!
┆Issue is synchronized with this Jira Task
linabutler commented
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1874029
Change performed by the Move to Bugzilla add-on.