Skip to main content

Module abi

Module abi 

Source
Expand description

Types and conventions for loading plugins from cdylib shared libraries.

Each plugin cdylib exports two symbols:

  • [DECLARATION_SYMBOL]: a static [PluginDeclaration] with metadata
  • [CREATE_SYMBOL]: a [CreateFn] that constructs the plugin

The loader reads the declaration first to check API/protocol compatibility, then calls the create function to obtain a Box<dyn Plugin>.

Structs§

PluginDeclaration
C-compatible plugin metadata exported as a #[no_mangle] static from each cdylib plugin.

Constants§

CREATE_SYMBOL
Null-terminated symbol name for the CreateFn function.
DECLARATION_SYMBOL
Null-terminated symbol name for the PluginDeclaration static.
DESTROY_SYMBOL
Null-terminated symbol name for the DestroyFn function.

Functions§

config_from_raw
Helper to extract a &str config from raw FFI pointers.

Type Aliases§

CreateFn
Type signature for the plugin creation function exported by cdylib plugins.
DestroyFn
Type signature for the plugin destruction function exported by cdylib plugins.