Skip to main content

export_plugin_v3

Macro export_plugin_v3 

Source
macro_rules! export_plugin_v3 {
    ($body:expr) => { ... };
}
Expand description

Export an ABI v3 plugin entrypoint under rpi_plugin_register_v3.

The expression receives (&PluginApiVt, &PluginApiVt3Ext) and returns the plugin-defined registration status code. Use this when the plugin wants to declare a priority / supported platforms through PluginApiVt3Ext::declare; otherwise prefer export_plugin_v2!.

ⓘ
rpi_plugin_sdk::export_plugin_v3!(|api, ext| {
    if let Some(declare) = ext.declare {
        declare(rpi_plugin_sdk::StbStringRef::from_str(
            r#"{"priority":60,"platforms":["linux"]}"#,
        ));
    }
    // ... register tools and handlers through `api` ...
    0
});