Replies: 1 comment
-
|
in #[pymodule(name = "child_module")]
pub mod module {
#[pyfunction]
fn func() -> String {
"func".to_string()
}
}... and then |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm following the submodule tutorial in the official doc, however I want to define my submodule in its own file:
src/lib.rs
src/child_module.rs
If I do it this way, the compiler complains that "
#[pymodule]can only be used on inline modules". If I remove #[pymodule] from abovemod child_module, the compiler complains "cannot find value_PYO3_DEFin module child_module". Besides, the compiler complains " the namefuncis defined multiple times". Do I still need the use statement?How can I define child_module in its own file?
Beta Was this translation helpful? Give feedback.
All reactions