How to pass a string into wasm then manipulate it, then return with a new string defined in wasm? is there any example for this?
can I pass a tcp connection to wasm module and handle it as a File? If I implement the WasiFile trait for it
As of wasmtime 1.0 you don't even need to implement WasiFile
: https://docs.rs/wasmtime-wasi/2.0.2/wasmtime_wasi/sync/struct.WasiCtxBuilder.html#method.preopened_socket
what does the fd in the function mean? the fd of the opened socket?
The fd that will be assigned to the socket in the guest.
okay thanks, I will try it out
Lann Martin said:
As of wasmtime 1.0 you don't even need to implement
WasiFile
: https://docs.rs/wasmtime-wasi/2.0.2/wasmtime_wasi/sync/struct.WasiCtxBuilder.html#method.preopened_socket
I am quite confused on this function, the Into<Socket> requires cap_std::net::TcpStream, while that is based on non-wasi
feature, which is kind of confusing, can you possibly explain it to me? thanks
Can anyone show me a very simple example of that function usage? I really don't know how to handle it correctly.
Last updated: Dec 23 2024 at 13:07 UTC