mitoxide-wasm

Crates.iomitoxide-wasm
lib.rsmitoxide-wasm
version0.1.0
created_at2025-10-16 15:58:53.053722+00
updated_at2025-10-16 15:58:53.053722+00
descriptionWASM runtime support for Mitoxide
homepagehttps://github.com/yourusername/mitoxide
repositoryhttps://github.com/yourusername/mitoxide
max_upload_size
id1886349
size35,087
Sebx (Sebx)

documentation

https://docs.rs/mitoxide-wasm

README

Mitoxide WASM

Crates.io Documentation License: MIT

WebAssembly runtime support for Mitoxide - enabling secure remote execution of WASM modules.

Features

  • WebAssembly module execution with Wasmtime
  • Sandboxed execution environment
  • JSON input/output serialization
  • Resource limits and security controls
  • WASI support for file system access

Usage

This crate is primarily used internally by Mitoxide, but can be used standalone for WASM execution.

use mitoxide_wasm::{WasmRuntime, WasmModule};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let runtime = WasmRuntime::new()?;
    
    // Load WASM module
    let module_bytes = std::fs::read("module.wasm")?;
    let module = WasmModule::from_bytes(&module_bytes)?;
    
    // Execute with JSON input
    let input = serde_json::json!({"message": "Hello, WASM!"});
    let result = runtime.execute(&module, &input).await?;
    
    println!("Result: {}", result);
    Ok(())
}

Security

The WASM runtime provides sandboxed execution with:

  • Memory limits
  • CPU time limits
  • File system access controls
  • Network access restrictions

Documentation

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt