#[ffi_export]Expand description
Attribute macro that takes an async (or sync) Rust function and emits a
matching extern "C" shim.
Supported signatures:
ⓘ
#[ffi_export]
pub fn balance(handle: WeyWalletHandle) -> i64 { ... }
#[ffi_export(name = "weby_wallet_open")]
pub async fn open(path: &str) -> Result<WeyWalletHandle, Error> { ... }Generates:
extern "C" fn weby_wallet_balance(handle: WeyWalletHandle) -> i64extern "C" fn weby_wallet_open(path: *const c_char, out: *mut WeyWalletHandle) -> i32— async wrapped via the FFI runtime; result marshaled to(error_code, out).
The macro recognises a small set of marshaling rules:
&str→*const c_char(read withCStr::from_ptr)String→*const c_char(caller frees nothing; we copy)Result<T, E>→ returnsi32with T written via*outptrResult<(), E>→ returnsi32i32/i64/u32/u64/bool/ opaque handle types → as-is