nemo-wasm-guest 0.6.0

WASM guest SDK for Nemo plugins
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 15.97 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 37s Average build duration of successful builds.
  • all releases: 33s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • geoffjay/nemo
    0 0 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • geoffjay

Documentation

nemo-wasm-guest

WASM guest SDK for building Nemo plugins as WebAssembly components.

This crate ships the WIT interface definition and re-exports wit-bindgen so plugin authors have everything they need to implement a Nemo WASM plugin.

Quick Start

wit_bindgen::generate!({
    path: "wit/nemo-plugin.wit",  // shipped with this crate
    world: "nemo-plugin",
});

use nemo::plugin::host_api;
use nemo::plugin::types::{LogLevel, PluginManifest, PluginValue};

struct MyPlugin;

impl Guest for MyPlugin {
    fn get_manifest() -> PluginManifest {
        PluginManifest {
            id: "my-plugin".into(),
            name: "My Plugin".into(),
            version: "0.1.0".into(),
            description: "A sample plugin".into(),
            author: Some("Author".into()),
        }
    }

    fn init() {
        host_api::log(LogLevel::Info, "Plugin initialized");
    }

    fn tick() -> u64 {
        0
    }
}

export!(MyPlugin);

Locating the WIT file

This crate sets the DEP_NEMO_WASM_GUEST_WIT_DIR environment variable via Cargo links metadata, so build scripts in consuming crates can locate the bundled WIT directory automatically.

License

MIT OR Apache-2.0