-
Notifications
You must be signed in to change notification settings - Fork 951
Closed
Labels
Description
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 Vecs 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 object
Is there a way to safely implement the buffer protocol for rust objects exposed by a #[pyclass] statement ?
Reactions are currently unavailable