Stream: general

Topic: wasi


view this post on Zulip Mitchell Hynes (Jul 04 2021 at 00:54):

bjorn3 said:

You can use .set_stdout and pass a custom type implementing WasiFile. In this implementation you can line buffer and then use info!() when the line gets flushed.

https://docs.rs/wasmtime-wasi/0.28.0/wasmtime_wasi/trait.WasiFile.html has a lot of functions that I don't want to implement. Is there an example I could follow of what you're describing here?

view this post on Zulip bjorn3 (Jul 04 2021 at 05:32):

You can look at the WasiFile impl for Stdout: https://docs.rs/wasmtime-wasi/0.28.0/wasmtime_wasi/sync/stdio/struct.Stdout.html Looks like there is also a WritePipe type that wraps any std::io::Write implementing type.


Last updated: Oct 23 2024 at 20:03 UTC