Skip to main content

export_plugin

Macro export_plugin 

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

Export a plugin constructor from a cdylib crate:

fn create() -> Box<dyn mir_plugin::MirPlugin> { Box::new(MyPlugin) }
mir_plugin::export_plugin!(create);

The dylib must be built with the same Rust toolchain and mir-plugin version as the mir binary that loads it — the loader refuses mismatched api_versions, but layout compatibility beyond that is on the builder.