-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implement the buffer protocol safely #657
Comments
Thank you for reporting it. |
I don't know for the code that is behind it (I can imagine that it can be easily headache with all these structs and traits ;) but I find the API of the |
Sorry, I'm saying about |
This is now tracked in #1884 as part of the move to |
Hi !
I'm using rust as backend for a python module I'm working on, to get high performances on mesh operations. The data is owned by some rust
Vec
s but I would like to expose its content to python, to make possible extend the module with pure python (or at least to get some data points).So I'm trying to implement the buffer protocol for my structs. I seen this page in pyo3. But it relies on pointers so it's unsafe.
But the buffer protocol is not incompatible with pyo3's safety since i read in the python doc that the
memoryview
object kept a hook on the viewed objectIs there a way to safely implement the buffer protocol for rust objects exposed by a
#[pyclass]
statement ?The text was updated successfully, but these errors were encountered: