Skip to main content

Crate ryo_plugin_loader

Crate ryo_plugin_loader 

Source
Expand description

§Ryo Plugin Loader

WASM plugin loader for ryo mutation plugins.

This crate provides the PluginLoader which loads WASM mutation plugins and provides an interface to call their exported functions.

§Architecture

ryo-plugin-loader                   ryo-executor
┌───────────────────────┐          ┌─────────────────────────┐
│ PluginLoader          │          │ MutationRegistry        │
│ ├─ load(bytes)        │──────────│ ├─ register_plugin()    │
│ └─ LoadedPlugin       │          │ └─ Apply mutations      │
└───────────────────────┘          └─────────────────────────┘

§Usage

use ryo_plugin_loader::PluginLoader;

let loader = PluginLoader::new()?;
let mut plugin = loader.load(&wasm_bytes)?;

println!("Loaded mutation: {}", plugin.manifest.name);

// For complex transforms (TransformDef::WasmExecute)
let edits = plugin.execute_transform(matches, context)?;

§Security

  • Fuel limits prevent infinite loops (10M instructions for init, 1M per transform)
  • Stack size limits prevent stack overflow (1MB)
  • WASI sandbox restricts filesystem/network access

Modules§

exports

Structs§

Capture
Captured node from pattern match
LoadedPlugin
A loaded mutation plugin with live WASM instance
MatchResult
Pattern match result
MutationManifest
Mutation manifest - returned once at plugin load
MutationPlugin
Auto-generated bindings for an instance a component which implements the world mutation-plugin.
MutationPluginIndices
Auto-generated bindings for index of the exports of mutation-plugin.
MutationPluginPre
Auto-generated bindings for a pre-instantiated version of a component which implements the world mutation-plugin.
PluginLoader
WASM Plugin Loader
TextEdit
Text edit operation (atomic change)
TransformContext
Transform execution context (passed to execute-transform)
TypeHint
Type information hint (from syn analysis)

Enums§

LoaderError
Error type for plugin loading and execution
MutationCategory
Mutation category
NodeKind
AST node kinds (Rust-specific)
TransformDef
Transform definition
TransformError
Transform error variants

Constants§

CURRENT_API_VERSION
Current API version