Skip to content

What is the best approach to export Rust struct that has nested structs to JavaScript? #3623

Closed Answered by aptivator
aptivator asked this question in Q&A
Discussion options

You must be logged in to vote

What I wound up doing is splitting my deeply nested configuration into three flat rust structures and then exporting them to JavaScript. Not as unified as having one struct, but workable enough. It would be nice to have a multi-level struct whose nested structs can be accessed without data being copied. If we can do that with the root struct, then it can be done with the nested structs also.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by aptivator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #3622 on September 19, 2023 03:43.