Replies: 1 comment
-
I didn't find a way to pass a closure but I found a way to implement my intended API differently. It's a bit more brittle than I would have liked but will do for now. So I'll go ahead and close this to not waste your time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanna create an API that looks like:
Both
rustyscript.functions.registered()
andhandle.fun()
are natively registered. That's all dandy. I'm just not sure how to receive the closure as a stored function that I can invoke from rust. The registered function (i.e.registered()
) receive JSON values butjs_value::Function
doesn't seem to be serializable.I did stumble upon
register_entrypoint
, which is the only thing I found accepting a closure. Maybe a red herring, maybe that could be a work around 🤷. Generally, is this something that's supported? How would you do it?Beta Was this translation helpful? Give feedback.
All reactions