(_env: JNIEnv<'_>)
| 10 | |
| 11 | impl JavaState { |
| 12 | pub fn new(_env: JNIEnv<'_>) -> Result<Self, Error> { |
| 13 | // TODO: Security considerations here, we don't want to capture the parent processes env |
| 14 | // we probably also want custom filehandles for the stdio of the module as well... |
| 15 | // |
| 16 | // see: https://docs.wasmtime.dev/examples-rust-wasi.html |
| 17 | let wasi = WasiCtxBuilder::new() |
| 18 | .inherit_stdio() |
| 19 | .inherit_args() |
| 20 | .context("failed to establish WASI context")? |
| 21 | .build(); |
| 22 | |
| 23 | Ok(JavaState { wasi }) |
| 24 | } |
| 25 | |
| 26 | pub fn wasi_mut(&mut self) -> &mut WasiCtx { |
| 27 | &mut self.wasi |
nothing calls this directly
no outgoing calls
no test coverage detected