time_tracker_plugin_sdk/ffi.rs
1//! FFI types for dynamic plugin loading
2//!
3//! Plugins compiled as dynamic libraries (.dll/.so/.dylib) must export
4//! these functions to be loadable by the core application.
5
6use crate::plugin::Plugin;
7
8/// Function pointer type for creating a plugin instance
9/// Plugins must export a function with this signature: `#[no_mangle] pub extern "C" fn _plugin_create() -> *mut dyn Plugin`
10pub type PluginCreateFn = unsafe extern "C" fn() -> *mut dyn Plugin;
11
12/// Function pointer type for destroying a plugin instance
13/// Plugins must export a function with this signature: `#[no_mangle] pub extern "C" fn _plugin_destroy(plugin: *mut dyn Plugin)`
14pub type PluginDestroyFn = unsafe extern "C" fn(*mut dyn Plugin);