gutil-plugin-sdk 0.1.0

SDK for gutil WebAssembly plug-ins
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented0 out of 4 items with examples
  • Size
  • Source code size: 47.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 118.3 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Leitwolf11/gutil
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Leitwolf11

gutil-plugin-sdk

Use this Rust library to write a WebAssembly module for gutil plug-in use. Name the binary target gutil-<command> and read the host invocation with gutil_plugin_sdk::Invocation::from_env().

cargo add gutil-plugin-sdk
use gutil_plugin_sdk::Invocation;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let invocation = Invocation::from_env()?;
    for argument in invocation.into_args() {
        println!("{argument:?}");
    }
    Ok(())
}

Compile the binary target for wasm32-wasip1. gutil runs the module in its own process and forwards UTF-8 arguments and standard streams. It provides the current working directory through WASI and sets GUTIL_PLUGIN_PROTOCOL=1.

See the gutil plug-in guide for packaging and installation.