hermit-wasm 0.1.1

Running WASM modules inside a lightweight virtual machine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::bindings::cli::exit;
use crate::{I32Exit, WasiImpl, WasiView};

impl<T> exit::Host for WasiImpl<T>
where
	T: WasiView,
{
	fn exit(&mut self, status: Result<(), ()>) -> anyhow::Result<()> {
		let status = match status {
			Ok(()) => 0,
			Err(()) => 1,
		};
		Err(anyhow::anyhow!(I32Exit(status)))
	}
}