Expand description
Void Rust SDK
This library provides helper macros and FFI boundaries to build stateful WebAssembly plugins in Rust for the Void framework runtime.
Macros§
- void_
plugin - Exports standard WebAssembly FFI functions (
void_invoke,void_free_string, etc.) and invokes the user’s plugin registration function on initialization.
Structs§
- Memory
Stats - Heap allocation statistics representing active FFI allocations inside the Rust SDK.
Enums§
- Value
- Represents any valid JSON value.
Functions§
- ensure_
registered - Verifies that user plugin registrations are fully initialized.
- get_
array - Extracts an Array parameter value from the arguments map.
- get_
bool - Extracts a boolean parameter value from the arguments map.
- get_
float - Extracts a 64-bit float parameter value from the arguments map.
- get_int
- Extracts a 64-bit integer parameter value from the arguments map.
- get_
memory_ stats - Retrieves active memory statistics for checking leaks and diagnostics.
- get_
null - Verifies that a field inside the map is a JSON
Nulltype. - get_
object - Extracts an Object parameter value from the arguments map.
- get_
string - Extracts a string parameter value from the arguments map.
- get_
value - Extracts a raw JSON
Valueparameter value from the arguments map. - pin_
memory ⚠ - Manually allocates and pins raw memory layout on the heap. Note: You MUST free it using unpin_memory to prevent memory leaks.
- register
- Registers a function handler under a specific name inside the dynamic FFI registry.
- unpin_
memory ⚠ - Unpins and deallocates a manually pinned raw memory block.
- void_
free ⚠ - Frees allocated memory blocks on the WebAssembly heap. This is called internally by the Javascript Host to clean arguments.
- void_
free_ ⚠string - Frees returned output strings allocated on the heap. This is called by the Host loader once JSON responses are fully parsed.
- void_
invoke - Core FFI entrypoint invoked by the Host. Parses the JSON string input, executes the registered function, and returns the response pointer.
- void_
malloc ⚠ - Allocates memory block on the WebAssembly heap. This is called internally by the Javascript Host to pass inputs.
Type Aliases§
- Native
Fn - Registry type mapping function name to a function pointer. Developers write handlers matching this signature.