It is nothing more than an edge case. Things might be done with a hand-writting macro.
I'm trying writting a macro about auto exporting function without explictly use the annoying macro:
extendr_module! {
mod rext;
fn hello_world;
}
Instead, if I success, just writting :
done!{Yes, it is done!};
is enough.
the trick should be re-define the function with the same name in a new module, for example, _please_do_not_use_rmin_export_interface_as_your_mod_name_, and use the following trick to merge all of the function in a single mod
mod private_foo {
#[no_mangle]
extern "C" fn foo(){} // not-so-private function
}
pub mod _please_do_not_use_rmin_export_interface_as_your_mod_name_ {
pub extern "C" {
fn foo();
}
const FOO_PTR:*const()=foo as *const_; // use pub extern fn foo::foo, which equals to the private_foo::foo thanks to the `#[no_mangle]` attribute.
}
That's all what I have found in the last week. Hope that may help develop a better rextendr:)
I might have several problem for packing R packages in the future (it cost me a day to switch the compile script to a ugly script compiles my crate), wondering is it possible to get some help here.
for example, such rust code works fine:
but rextendr has issue exporting it.
It is nothing more than an edge case. Things might be done with a hand-writting macro.
I'm trying writting a macro about auto exporting function without explictly use the annoying macro:
Instead, if I success, just writting :
is enough.
the trick should be re-define the function with the same name in a new module, for example,
_please_do_not_use_rmin_export_interface_as_your_mod_name_
, and use the following trick to merge all of the function in a singlemod
That's all what I have found in the last week. Hope that may help develop a better rextendr:)
I might have several problem for packing R packages in the future (it cost me a day to switch the compile script to a ugly script compiles my crate), wondering is it possible to get some help here.