A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
pub mod async_;
pub mod http;
pub mod nn;
pub mod p3;
pub mod preview1;
pub mod sockets;
pub mod tls;
wit_bindgen::generate!({
inline: "
package wasmtime:test;
world test {
include wasi:cli/[email protected];
include wasi:http/[email protected];
include wasi:config/[email protected];
include wasi:keyvalue/[email protected];
include wasi:tls/[email protected];
}
",
path: [
"../wasi-http/wit",
"../wasi-config/wit",
"../wasi-keyvalue/wit",
"../wasi-tls/wit/deps/tls",
],
world: "wasmtime:test/test",
features: ["cli-exit-with-code", "tls"],
generate_all,
});
pub mod proxy {
wit_bindgen::generate!({
path: "../wasi-http/wit",
world: "wasi:http/proxy",
default_bindings_module: "test_programs::proxy",
pub_export_macro: true,
with: {
"wasi:http/[email protected]": crate::wasi::http::types,
"wasi:http/[email protected]": crate::wasi::http::outgoing_handler,
"wasi:random/[email protected]": crate::wasi::random::random,
"wasi:io/[email protected]": crate::wasi::io::error,
"wasi:io/[email protected]": crate::wasi::io::poll,
"wasi:io/[email protected]": crate::wasi::io::streams,
"wasi:cli/[email protected]": crate::wasi::cli::stdout,
"wasi:cli/[email protected]": crate::wasi::cli::stderr,
"wasi:cli/[email protected]": crate::wasi::cli::stdin,
"wasi:clocks/[email protected]": crate::wasi::clocks::monotonic_clock,
"wasi:clocks/[email protected]": crate::wasi::clocks::wall_clock,
},
});
}
impl std::fmt::Display for wasi::io::error::Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.to_debug_string())
}
}
impl std::error::Error for wasi::io::error::Error {}