2 releases
0.1.1-rc1 | Sep 7, 2023 |
---|---|
0.1.0 | Sep 5, 2023 |
#2752 in Rust patterns
44,261 downloads per month
Used in 32 crates
(2 directly)
13KB
175 lines
::extern-c
Convert a zero-sized closure into an extern "C" fn(…)
pointer with the
same[^abi] type signature.
[^abi]: but for the ABI, of course!
Example
use ::extern_c::extern_c;
let f: extern "C" fn(bool) -> u8 = extern_c(|b: bool| b as u8);
assert_eq!(f(true), 1);
Dependencies
~8KB