MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / PyBuffer

Class PyBuffer

src/buffer.rs:29–29  ·  view source on GitHub ↗

Allows access to the underlying buffer used by a python object such as `bytes`, `bytearray` or `array.array`.

Source from the content-addressed store, hash-verified

27
28/// Allows access to the underlying buffer used by a python object such as `bytes`, `bytearray` or `array.array`.
29pub 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.

Callers 1

getMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected