Skip to main content

Crate execsandbox

Crate execsandbox 

Source
Expand description

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 and conn_write work with &[u8]/Vec<u8>, Kind identifies what recv returned, and timeouts are an Option<Duration>.

This crate must be built for wasm32-wasip1 — the ABI it wraps only exists on that target. It has no dependency on the ExecSandbox host’s own code; the ABI it binds to is defined by the host project at https://github.com/amisonnet8/execsandbox (docs/spec/execsandbox_spec_ja.md, section 5), which this crate treats as the sole source of truth.

Structs§

Message
One item taken off this sandbox’s mailbox by recv.
UnknownConnection
Error returned by conn_write when conn_id does not name a currently open connection (spec section 5.4).

Enums§

Kind
Identifies what a received Message represents.

Functions§

conn_write
Writes data to the external connection identified by conn_id. Returns UnknownConnection if conn_id does not name a currently open connection (spec section 5.4).
max_frame
Reports the maximum frame size, in bytes, that this ExecSandbox instance was configured with (the host’s --max-frame flag).
recv
Takes one message off this sandbox’s mailbox.
send
Sends data to the destination numbered dest, as wired up for this sandbox instance at launch time (the host’s -d flag).