Skip to content

Is there a reason why TryFromJsValue takes ownership of the JsValue? #4022

Answered by daxpedda
hrxi asked this question in Q&A
Discussion options

You must be logged in to vote

So TryFromJsValue is an internal API

I'm not sure what you mean by "internal API". It seems to be exposed: wasm_bindgen::convert::TryFromJsValue.

It says right there at the top of the module:

This is mostly an internal module, no stability guarantees are provided. Use at your own risk.

Unless you know exactly what you are doing, don't use this API.
Its meant for proc-macros and using wasm-bindgen descriptors to define how exports/imports are generated.


What kind of type is PublicKey?
I assume its an exported type?
You should probably take a look at JsCast.

Replies: 5 comments 2 replies

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
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@hrxi
Comment options

@sisou
Comment options

Answer selected by hrxi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3974 on July 29, 2024 09:28.