Files
metabuilder/workflow/plugins/rust/README.md
johndoe6345789 48135c81e6 feat: Propagate workflow plugins to Go, Rust, C++, and Mojo
Multi-language workflow plugin system following Python's structure:
- Each plugin in its own directory with implementation + package.json
- Category-level package.json manifests listing all plugins
- Consistent interface: run(runtime, inputs) -> outputs

Languages added:
- Go: math, string, logic, list, dict, var, convert (25+ plugins)
- Rust: math, string, logic, list, convert, var (50+ functions)
- C++: header-only math, string, logic, var, convert (30+ plugins)
- Mojo: math, string, list with systems programming features

Python structure fixed:
- Reorganized flat files into plugin subdirectories
- Added package.json metadata to all 120+ plugins
- Added missing backend category (15 plugins)
- Category manifests with plugin lists

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:42:14 +00:00

67 lines
1.7 KiB
Markdown

# Rust Workflow Plugins
High-performance Rust plugins for MetaBuilder workflow engine.
## Plugin Interface
```rust
// All plugins implement this signature
pub fn run(runtime: &mut Runtime, inputs: &HashMap<String, Value>) -> PluginResult;
```
The `runtime` object provides:
- `store` - Workflow state storage (persists between nodes)
- `context` - Shared context (clients, configuration)
## Categories
| Category | Plugins | Purpose |
|----------|---------|---------|
| convert | to_string, to_number, to_boolean, to_json, parse_json, to_list, to_object | Type conversion |
| list | concat, length, slice, reverse, first, last, at, contains, index_of, unique | List operations |
| logic | and, or, not, xor, equals, gt, gte, lt, lte, is_in | Boolean logic |
| math | add, subtract, multiply, divide, modulo, power, abs, round | Arithmetic |
| string | concat, split, replace, upper, lower, trim, length, contains, starts_with, ends_with | String manipulation |
| var | get, set, delete, exists, keys, clear | Variable management |
## Building
```bash
cd workflow/plugins/rust
cargo build --release
```
## Example Usage
### In Workflow JSON
```json
{
"version": "2.2.0",
"nodes": [
{
"id": "process-data",
"type": "operation",
"op": "rust.list.unique",
"params": {
"list": [1, 2, 2, 3, 3, 3, 4]
}
}
]
}
```
## Performance
Rust plugins offer:
- **100-1000x faster** than Python for CPU-bound operations
- **Zero-cost abstractions** - no runtime overhead
- **Memory safety** - guaranteed by compiler
- **Native FFI** - can be called from any language
Best for:
- High-performance data processing
- Memory-intensive operations
- Bulk transformations (1M+ items)
- Security-critical operations