Skip to main content

export_plugin

Macro export_plugin 

Source
macro_rules! export_plugin {
    ($plugin_type:ty) => { ... };
}
Expand description

Generate the FFI entry point for a MultiToolPlugin.

This macro expands to an extern "C" function named cortex_plugin_create_multi that the runtime calls via dlopen / dlsym. The plugin type must implement Default.

§Usage

cortex_sdk::export_plugin!(MyPlugin);

§Expansion

The macro expands to an extern "C" fn cortex_plugin_create_multi() that constructs the plugin via Default::default() and returns a raw pointer to the MultiToolPlugin trait object.