macro_rules! declare_plugin {
($ty: path) => { ... };
}Expand description
This macro adds non-mangled functions which provides plugin version and loads it into the host. If plugin library should work also as static, consider calling this macro under feature condition
The functions declared by this macro are:
get_plugin_loader_version- returnsPLUGIN_LOADER_VERSIONconst of the crate. ThePluginsManagerwill check if this version is compatible with the host.get_compatibility- returnsCompatibilitystruct which contains all version information (Rust compiler version, features used, version of plugin’s structures). The layout of this structure is guaranteed to be stable until thePLUGIN_LOADER_VERSIONis changed, so it’s safe to use it in the host after call toget_plugin_loader_versionreturns compatible version. Then thePluginsManagercompares the returnedCompatibilitywith it’s own and decides if it can continue loading the plugin.load_plugin- returnsPluginVTablewhich is able to create plugin’s instance.