Macro interoptopus::function
source · macro_rules! function { ($x:ty) => { ... }; }
Expand description
Register a function with an InventoryBuilder
.
You must also annotate the function with #[ffi_function]
, and preferably with #[no_mangle]
and extern "C"
.
§Example
use interoptopus::{ffi_function, Inventory, InventoryBuilder, function};
#[ffi_function]
#[no_mangle]
pub extern "C" fn my_function() { }
pub fn inventory() -> Inventory {
InventoryBuilder::new()
.register(function!(my_function))
.inventory()
}