How to handle 3rd party types not implementing IntoWasmAbi and FromWasmAbi? #3654
Unanswered
ChristianIvicevic
asked this question in
Q&A
Replies: 2 comments 3 replies
-
You could ask This generally seems like a similar problem to implementing Serde on foreign types, but |
Beta Was this translation helpful? Give feedback.
2 replies
-
What I did for my project was just forking the crate and adding it to the workspace, then manually patching it myself. I did this for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For some precise computations I am using
rust_decimal::Decimal
in my structs as follows:Of couse this doesn't compile as
Decimal
doesn't implementIntoWasmAbi
andFromWasmAbi
. Even manually attempting to implement them would not work since it's a type from a foreign crate. One workaround is a mapped struct that can be serialized across the border like this:But this introduces a lot of cognitive overhead doubling the amount of types just to be able to pass around data back and forth. Is there an idiomatic approach to that?
Beta Was this translation helpful? Give feedback.
All reactions