You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the rust/src where the lib.rs and core.rs are put together. I would like to use functions from core.rs in extendr_module!, located in lib.rs. Is it possible to do without too much overhead?
lib.rs:
use extendr_api::prelude::*;
mod core;
use core::load;
// Macro to generate exports.
// This ensures exported functions are registered with R.
// See corresponding C code in `entrypoint.c`.
extendr_module! {
mod rpackage;
fn load;
}
core.rs:
use extendr_api::prelude::*;
/// test function
/// @export
#[extendr]
pub fn load() {
...
}
The error is showed on lib.rs, in fn load:
cannot find function `meta__load` in this scope
not found in this scoperustc[E0425](https://doc.rust-lang.org/error-index.html#E0425)
core.rs(13, 1): function `crate::core::meta__load` exists but is inaccessible
The text was updated successfully, but these errors were encountered:
I think you need to put extendr_module!{} in each module you are trying to export.
As a side note, I'd suggest to have a single module exposing Rust API to R rather than scatter exported function over multiple files.
I think you need to put extendr_module!{} in each module you are trying to export. As a side note, I'd suggest to have a single module exposing Rust API to R rather than scatter exported function over multiple files.
This doesn't work. It gives an error like
Objects listed as exports, but not present in namespace:
I have the
rust/src
where the lib.rs and core.rs are put together. I would like to use functions from core.rs inextendr_module!
, located in lib.rs. Is it possible to do without too much overhead?lib.rs:
core.rs:
The error is showed on lib.rs, in
fn load
:The text was updated successfully, but these errors were encountered: