uniffi-rs
uniffi-rs copied to clipboard
Support immutable constants in the IDL
For Nimbus, it would be useful to have the component export some constants for well-known server configurations like PRODUCTION and STAGING. It looks like WebIDL has some syntactic support for constants but they only exist as part of interfaces; you can also specify readonly namespace attributes which might be a better fit for our mis-use of WebIDL.
This issue is to investigate whether it's something we can support directly in uniffi in its current state, and propose an implementation if so.
┆Issue is synchronized with this Jira Task ┆Issue Number: UNIFFI-30
A strawfox syntax would be something like:
namespace nimbus {
readonly attribute RemoteSettingsConfig SERVER_PRODUCTION;
readonly attribute RemoteSettingsConfig SERVER_STAGING;
}
Which is a bit awkward because of the way we abuse the namspace block, but may be workable for a first pass at this.
Duplicate of #1480
-- Let's use the newer one for feature discussion.