Expand description
PluMA Rust Plugin Interface
This module provides the interface for writing PluMA plugins in Rust.
It integrates with the pluma-plugin-trait crate and provides FFI exports
for the PluMA plugin system.
§Example Plugin
use pluma_plugin_trait::PlumaPlugin;
use pluma_io::PluginManager;
pub struct MyPlugin {
data: String,
}
impl PlumaPlugin for MyPlugin {
fn new() -> Self {
MyPlugin { data: String::new() }
}
fn input(&mut self, filename: &str) {
// Read input data
self.data = std::fs::read_to_string(filename).unwrap_or_default();
}
fn run(&mut self) {
// Process data
self.data = self.data.to_uppercase();
}
fn output(&mut self, filename: &str) {
// Write output data
std::fs::write(filename, &self.data).ok();
}
}
// Export the plugin for PluMA
pluma_plugin_trait::export_plugin!(MyPlugin);Macros§
- pluma_
export_ plugin - Macro to generate FFI exports for a PluMA plugin
Structs§
- Plugin
Manager - PluginManager provides access to PluMA runtime functions. This mirrors the C++ PluginManager interface.
Functions§
- c_
str_ ⚠to_ string - Convert a C string pointer to a Rust String