[][src]Crate wasi_binio_shared_mods

wasi_binio_shared for wasi_binio_host and wasi_binio_wasm

wasi_binio_wasm is the host crate of wasm_binio. Another crate is wasi_binio_host which used in host. wasi_binio_host creates a call_stub so that host can call a webassembly function with complex data structure arguments and results. wasi_binio_wasm prepare the linear memory buffer and exports required wasm function so that the host can call.

As of today, wasm function can only take i32 i64 f32 f64 types. If you have a function in wasm like this In wasm: do_compute(point1: &Point, point2: &Point)->Rect {...} there is no way to call it directly from host. With the help from wasm_binio, we can instead call the call_stub function and send arguments and results like this

Functions

join_i32_to_i64

Combain two i32 into one i64

split_i64_to_i32

Split one i64 into two i32