can someone please help me how to call this struct so that I don't get this error #4384
Unanswered
AriBermeki
asked this question in
Questions
Replies: 1 comment 3 replies
-
Since To do this safely, you can for example use an #[pyclass]
pub struct PyNexium {
window: Option<Nexium>,
}
#[pymethods]
impl PyNexium {
#[new]
pub fn new() -> PyNexium {
let main_window = Nexium::new();
PyNexium { window: Some(main_window) }
}
pub fn start(&mut self, json_data: &str) -> PyResult<()> {
if let Some(win) = self.window.take() {
win.run(json_data.into());
Ok(())
} else {
Err(PyRuntimeError::new_err("already started"))
}
}
}
|
Beta Was this translation helpful? Give feedback.
3 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.
-
Error
app.rs
lib.rs
Beta Was this translation helpful? Give feedback.
All reactions