Passing function pointer from Rust to C++
diff --git a/src/function.rs b/src/function.rs
new file mode 100644
index 0000000..1166b3d
--- /dev/null
+++ b/src/function.rs
@@ -0,0 +1,5 @@
+#[repr(C)]
+pub struct FatFunction {
+ pub trampoline: *const (),
+ pub ptr: *const (),
+}
diff --git a/src/lib.rs b/src/lib.rs
index 09326f5..3aaf172 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -356,6 +356,7 @@
mod cxx_string;
mod error;
mod exception;
+mod function;
mod gen;
mod opaque;
mod paths;
@@ -374,6 +375,7 @@
// Not public API.
#[doc(hidden)]
pub mod private {
+ pub use crate::function::FatFunction;
pub use crate::opaque::Opaque;
pub use crate::result::{r#try, Result};
pub use crate::rust_str::RustStr;