Skip to main content

OutputHook

Type Alias OutputHook 

Source
pub type OutputHook = fn(bytes: &[u8]) -> Result<()>;
Expand description

Function-pointer signature for writing bytes to a host-provided output stream, installed on GlobalState::stdout_hook or GlobalState::stderr_hook by the embedder.

Bare wasm32-unknown-unknown has no ambient stdout/stderr. Keeping output behind explicit hooks lets sandboxed and WASM hosts decide whether output is unavailable, buffered, or bridged to something like a browser console.