Skip to main content

Module ffi

Module ffi 

Source
Expand description

Stable C ABI for dynamic appctl sync plugins.

The host (appctl binary) loads a cdylib built against this crate, calls appctl_plugin_register, and receives a PluginManifest containing a PluginVtable of extern “C” function pointers.

JSON is used as the wire format between host and plugin so the ABI does not depend on matching Rust toolchains or serde versions.

Structs§

IntrospectResponse
JSON envelope returned by the plugin’s introspect function on success.
PluginManifest
Static metadata returned by every plugin.
PluginVtable
Function pointer table. Every function takes and returns heap-allocated null-terminated UTF-8 JSON strings the host must free via free_string.

Constants§

SDK_ABI_VERSION
Bumped whenever the vtable shape changes. Plugins must refuse to load if the host reports a different value.

Functions§

cstr_to_string
Used by the host to recover a string returned from a plugin.