I attempted to add #[pyclass] to a struct that includes Rc, but I encountered the following error.
error[E0277]: std::rc::Rc<MyStruct>
cannot be sent between threads safely
Here's my source code:
struct MyStruct {
name: String,
}
#[pyclass]
struct PyMyStruct {
ptr: std::rc::Rc<MyStruct>,
}
How can I resolve this issue and successfully add #[pyclass] to a struct that uses Rc in PyO3?"