Allows access to the underlying buffer used by a python object such as `bytes`, `bytearray` or `array.array`.
| 27 | |
| 28 | /// Allows access to the underlying buffer used by a python object such as `bytes`, `bytearray` or `array.array`. |
| 29 | pub struct PyBuffer(Box<ffi::Py_buffer>); // use Box<> because Python expects that the Py_buffer struct has a stable memory address |
| 30 | |
| 31 | // PyBuffer is thread-safe: the shape of the buffer is immutable while a Py_buffer exists. |
| 32 | // Accessing the buffer contents is protected using the GIL. |