#wasm #plugin

wasm_plugin_guest

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

6 releases

0.1.5 May 1, 2021
0.1.4 Apr 23, 2021
0.1.2 Mar 4, 2021

#310 in WebAssembly

Download history 42/week @ 2021-02-27 15/week @ 2021-03-06 7/week @ 2021-03-20 6/week @ 2021-03-27 7/week @ 2021-04-03 6/week @ 2021-04-10 35/week @ 2021-04-17 10/week @ 2021-04-24 26/week @ 2021-05-01 2/week @ 2021-05-08 10/week @ 2021-05-15 1/week @ 2021-05-22 6/week @ 2021-06-05

52 downloads per month

MIT license

17KB
299 lines

Crates.io Docs.rs license

A low-ish level tool for easily writing WASM based plugins to be hosted by wasm_plugin_host.

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 are meant to be run using wasm_plugin_host

Exporting a function is just a matter of adding an attribute.

#[wasm_plugin_guest::export_function]
fn hello() -> String {
    "Hello, host!".to_string()
}

API Stability

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


lib.rs:

A low-ish level tool for easily writing WASM based plugins to be hosted by wasm_plugin_host.

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.

This crate currently supports serialization either using bincode or json selected by feature: serialize_bincode: Uses serde and bincode. It is selected by default. serialize_json: Uses serde and serde_json. `serialize_nanoserde_json': Uses nanoserde.

Bincode is likely the best choice if all plugins the system uses will be written in Rust. Json is useful if a mix or languages will be used.

Plugins are meant to be run using wasm_plugin_host

Dependencies

~0.4–1MB
~25K SLoC