execsandbox 0.1.1

Rust bindings for ExecSandbox's WASM guest ABI (send/recv/conn_write/max_frame), for guest modules built for wasm32-wasip1.
Documentation
  • Coverage
  • 100%
    15 out of 15 items documented4 out of 7 items with examples
  • Size
  • Source code size: 28.0 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 412.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • amisonnet8/execsandbox-sdk
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • amisonnet8

execsandbox

Crates.io docs.rs

Rust bindings for ExecSandbox's WASM guest ABI (send/recv/conn_write/max_frame), for guest modules built for the wasm32-wasip1 target.

It hides pointer/length plumbing and buffer sizing behind a small Rust-native API: send/recv/conn_write work with &[u8]/Vec<u8>, a Kind enum identifies what recv returned, and timeouts are an Option<Duration>.

Install

cargo add execsandbox

Usage

This crate only makes sense inside a guest module built for a wasm target — build it for wasm32-wasip1, not the host architecture:

cargo build --target wasm32-wasip1 --release
fn main() {
    execsandbox::send(1, b"hello");

    if let Some(msg) = execsandbox::recv(None) { // block until one message arrives
        if msg.kind == execsandbox::Kind::ConnData {
            let _ = execsandbox::conn_write(msg.conn_id, &msg.data);
        }
    }
}

See examples/ for complete, runnable guest modules, and the crate documentation for the full API.

ABI compatibility

This crate binds to ExecSandbox's WASM ABI, which the host project only guarantees backward compatibility for: an ExecSandbox host at or newer than the version this crate's ABI functions were introduced in will run guest modules built with this crate. The ABI itself is defined by the host project, not by this crate — see docs/spec/execsandbox_spec_ja.md, section 5.


日本語版は README_ja.md を参照してください。