Closed khandar-william closed 2 months ago
At the moment guest code with no_std cannot return a string as serde does not support serializing strings in no_std. We do however have experimental std support which will allow this.
To use it, reinstall the jolt tool if you had installed it more than a few days ago and rerun jolt install-toolchain
. From there add the guest-std
feature to the jolt import in the cargo file of the guest and remove the no_std
declaration on the top of your guest's lib.rs
.
This should give you full access to the standard library with no need to use alloc
along with support for using strings as inputs and output.s
So from the initial Jolt project (created with
jolt new
), I tried adding this new function inguest/src/lib.rs
Then calling it from the
main.rs
But I got this error
Is this expected? Can guest code function return String?