flutter_rust_bridge
flutter_rust_bridge copied to clipboard
Ignore non-opaque struct fields
I was excited to see the support of #[frb(ignore)] for struct fields and was a bit frustrated when I realized it seems not to apply for non opaque structs.
I have some structs that contain types that flutter_rust_bridge isn't able to process (panicking when trying to generate Flutter code), and that in any case shouldn't be exposed to the Flutter side. The current state of affair requires me to create "mirror" struct types excluding any problematic fields so I can pass them to Flutter.
It would be ideal if instead I could simply:
#[frb(non_opaque)]
pub struct CommandResponse {
pub hello: f64,
#[frb(ignore)]
pub world: ProblematicType,
}
Such that frb wont attempt to generate code for ProblematicType and wont include the field world into the generated Flutter class for CommandResponse.
Hi! Thanks for opening your first issue here! :smile:
Hmm, for non-opaque types, if there is an ignored field, it seems that we do not know how to fill the value of it :/
Close since inactivity, but if there are any thoughts feel free to discuss!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.