#wasm #plugin

wasm_plugin_host

A low-ish level tool for easily hosting WASM based plugins

8 releases

0.1.7 May 7, 2021
0.1.6 May 1, 2021
0.1.5 Apr 23, 2021
0.1.2 Mar 4, 2021

#222 in WebAssembly

Download history 41/week @ 2021-02-27 15/week @ 2021-03-06 1/week @ 2021-03-13 7/week @ 2021-03-20 6/week @ 2021-03-27 7/week @ 2021-04-03 6/week @ 2021-04-10 52/week @ 2021-04-17 11/week @ 2021-04-24 32/week @ 2021-05-01 16/week @ 2021-05-08 15/week @ 2021-05-15 1/week @ 2021-05-22 8/week @ 2021-06-05

65 downloads per month

MIT license

30KB
639 lines

Crates.io Docs.rs license

A low-ish level tool for easily hosting WASM based plugins.

The goal of wasm_plugin is to make communicating across the host-plugin boundary as simple and idiomatic as possible while being unopinionated about how you actually use the plugin.

Plugins should be written using wasm_plugin_guest

Loading a plugin is as simple as reading the .wasm file off disk.

let mut plugin = WasmPluginBuilder::from_file("path/to/plugin.wasm")?.finish()?;

Calling functions exported by the plugin takes one of two forms. Either the function takes no arguments and returns a single serde deserializable value:

let response: ResultType = plugin.call_function("function_name")?;

Or it takes a single serializable argument and returns a single result:

let message = Message::default();
let response: ResultType = plugin.call_function_with_argument("function_name", &message)?;

API Stability

I am not currently guaranteeing any stability, expect all releases to include breaking changes.

Dependencies

~7.5MB
~159K SLoC