gravel_ffi/
prefix.rs

1use crate::{PluginDefinition, logging::BoxDynLogTarget};
2use abi_stable::{StableAbi, library::RootModule, sabi_types::VersionStrings, std_types::RVec};
3use abi_stable::{declare_root_module_statics, package_version_strings};
4
5/// [`RootModule`] for a plugin. It is auto-implemented using the macros.
6#[repr(C)]
7#[derive(StableAbi)]
8#[sabi(kind(Prefix(prefix_ref = PluginLibRef)))]
9pub struct PluginLib {
10	#[sabi(last_prefix_field)]
11	pub plugin: extern "C" fn(log_target: BoxDynLogTarget) -> RVec<PluginDefinition>,
12}
13
14impl RootModule for PluginLibRef {
15	declare_root_module_statics! {PluginLibRef}
16
17	const BASE_NAME: &'static str = "gravel_ffi";
18	const NAME: &'static str = "gravel_ffi";
19	const VERSION_STRINGS: VersionStrings = package_version_strings!();
20}