The trait Termination is not implemented for String #2917
-
Hello, I am trying to convert a function from an existing rust program to a pyfunction such that I can call it from Python. However, when I set it up to return a String as a PyResult I am getting the error in the title. Note: I am extremely new to Rust, so it may be I just have no idea what I am doing with this. Any help is appreciated as I've been stuck for a bit trying to get this work. See below for a screenshot of the error. Here is the code:
If you want to view the original repo here it is: https://github.com/demostf/parser |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try the following instead, which uses a different name in Python than in Rust: #[pyfunction(name="main")]
fn py_main( |
Beta Was this translation helpful? Give feedback.
main
is a special function name so the Rust compiler is applying special handling to it.Try the following instead, which uses a different name in Python than in Rust: