-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Describe the enhancement
We have migrated away from .udl
to proc macros almost completely, so it would be nice to finish the "completely" part and remove the "almost".
Problem
We don't seem to be able to totally migrate away right now thought because of Network
.
I don't think we can remove this at the moment, because the bitcoin::Network
enum is marked #[non_exhaustive]
in the bitcoin crate, making it incompatible with UniFFI's proc macro system.
Non-exhaustive enums can have new variants added in future versions but UniFFI's #[derive(uniffi::Enum)]
requires exhaustive pattern matching for safe code gen ([NonExhaustive, Remote]
attributes in .udl
are a workaround that allows UniFFI to compile while acknowledging the limitation).
So the only option I can think of to expose it via proc macros would be we'd need to create our own local exhaustive enum and manually convert between it and bitcoin::Network
(not saying that's what we'd want to do at all though even if it "works"!).
If you have any other ideas (or if I'm misunderstanding what I described above!) let me know.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status