macro_rules! declare_plugin {
($name:expr, $create:expr) => { ... };
}Expand description
Declares the C ABI entry points for a cdylib plugin.
Generates three #[no_mangle] exports:
ROOM_PLUGIN_DECLARATION— aabi::PluginDeclarationstaticroom_plugin_create— calls the provided closure with a&strconfig and returns a double-boxeddyn Pluginroom_plugin_destroy— frees a plugin returned byroom_plugin_create
§Arguments
$name— plugin name as a string literal (e.g."taskboard")$create— an expression that takesconfig: &strand returnsimpl Plugin(e.g. a closure or function call)
§Example
ⓘ
use room_protocol::declare_plugin;
declare_plugin!("my-plugin", |config: &str| {
MyPlugin::from_config(config)
});