Module ffi

Module ffi 

Source
Expand description

FFI declarations and memory management.

This module handles all the low-level FFI details so plugin developers don’t have to.

Macros§

orbis_allocators
Define memory allocation functions for the plugin
orbis_plugin
Define a complete plugin with minimal boilerplate
wrap_handler
Wraps a handler function to handle FFI details automatically

Functions§

allocate_internal
Internal allocator for WASM - exported through orbis_plugin! macro
deallocate_internal
Internal deallocator - exported through orbis_plugin! macro
log
Shadow implementation of the log function for non-WASM targets
read_bytes
Read bytes from a raw pointer with length
read_length_prefixed
Read a length-prefixed value from a pointer
return_bytes
Write a string/bytes and return ptr as i32 (for returning from handlers)
return_json
Write JSON and return ptr as i32
write_length_prefixed
Write data with length prefix