Procedural macros for mimium plugin development.
This crate provides attribute macros that simplify the definition of plugin functions by automatically generating the boilerplate required to bridge between idiomatic Rust and mimium's runtime FFI.
Overview
Runtime Functions (mimium_plugin_fn)
Plugin authors write methods using normal Rust types (e.g. f64 arguments
and return values). The [mimium_plugin_fn] macro transforms each annotated
method into a pair:
- A private helper retaining the original signature and body.
- A public wrapper with the
(&mut Self, &mut Machine) -> ReturnCodesignature expected bySystemPluginFnType.
Internally the wrapper creates a RuntimeHandle
and performs all argument extraction / return-value writing through it,
ensuring that the actual plugin logic is decoupled from the VM implementation.
Macro Functions (mimium_plugin_macro)
For compile-time code generation, the [mimium_plugin_macro] attribute transforms
methods with the signature (&mut self, &[(Value, TypeNodeId)]) -> Value into
FFI-compatible wrappers that handle serialization/deserialization automatically.
Example
use ;