wasm_plugin_host

Crates.iowasm_plugin_host
lib.rswasm_plugin_host
version0.1.7
sourcesrc
created_at2021-03-03 18:34:44.406457
updated_at2021-05-07 20:21:16.56579
descriptionA low-ish level tool for easily hosting WASM based plugins
homepage
repositoryhttps://github.com/alec-deason/wasm_plugin/tree/main/host
max_upload_size
id363303
size30,841
Alec Deason (alec-deason)

documentation

README

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.

Commit count: 0

cargo fmt